hibernated icon indicating copy to clipboard operation
hibernated copied to clipboard

add support for unique constraint

Open SingingBush opened this issue 9 years ago • 3 comments

The @Column definition currently:

struct Column {
    immutable string name;
    immutable int length;
}

It would be great if there was a third parameter to mark a column as being unique:

struct Column {
    immutable string name;
    immutable int length;
    immutable bool unique;
}

SingingBush avatar Aug 29 '16 15:08 SingingBush

I believe @UniqueKey() annotation is to be used instead @Entity class Value { @Id @Generated int id; @Column("name") @UniqueKey("name_index") string name; }

Let me know if it's not working as expected. Closing issue so far.

buggins avatar Sep 16 '16 08:09 buggins

thanks for this. I've tried using it but it doesn't seem to work for me.

SingingBush avatar Sep 16 '16 20:09 SingingBush

I tried using it, it didn't work for me either.

KrzaQ avatar Feb 25 '17 05:02 KrzaQ