Open JimeFuture opened 3 years ago
This seems to be because SchemaUtils#create
deliberately separates the index creation from the table create.
To add a unique column definition directly in CREATE TABLE
, Column.withDefinition()
will become available in upcoming version 0.52.0:
val orderNumber = long("ordernumber").withDefinition("UNIQUE").autoIncrement()
This will not add an index instance to Table.indices
, however. This means that using, for example, SchemaUtils.createMissingTablesAndColumns()
will work except a message will be logged (due to database having column index that is not found in Exposed table object).
Maybe i'm wrong but setting a column like: long("ordernumber").uniqueIndex().autoIncrement()
should be fine in case of Mysql. In newer versions its allowed to have a autoincrement column without the constraint of haveing it to be the primary key.
I got the following error:
I not even see the unique Index there....
Using exposed : 0.32.1 with jdbc for mysql