You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
object Lands : IntIdTable() {
val number = integer("ID_NUMBER")
val index = varchar("ID_INDEX", 5).default("")
override val primaryKey = PrimaryKey(number, index)
}
SQL:
create table LANDS
(
ID INT auto_increment,
ID_NUMBER INT not null,
ID_INDEX VARCHAR(5) not null, // must append: default ''
constraint PK_LANDS
primary key (ID_NUMBER, ID_INDEX),
);
Correctly generated
CODE:
object LandsTestPrimaryKey : Table() {
val number = integer("ID_NUMBER")
val index = varchar("ID_INDEX", 5).default("")
}
SQL:
create table LANDSTESTPRIMARYKEY
(
ID_NUMBER INT not null,
ID_INDEX VARCHAR(5) default '' not null,
constraint LANDS_LANDSTESTPRIMARYKEY_ID_NUMBER_ID_INDEX_FX
foreign key (ID_NUMBER, ID_INDEX) references LANDS (ID_NUMBER, ID_INDEX)
);
PS: I generate the foreign key myself, since it is a composite(#511)
The text was updated successfully, but these errors were encountered:
Incorrectly generated
CODE:
SQL:
Correctly generated
CODE:
SQL:
PS: I generate the foreign key myself, since it is a composite(#511)
The text was updated successfully, but these errors were encountered: