timm
02/10/2019, 8:41 PMoverride val id: Column<EntityID<Long>> = long("id").autoIncrement("hibernate_sequence").primaryKey().entityId()
timm
02/11/2019, 6:19 AMobject Cities : Table() {
val id = integer("id").autoIncrement("my_sequence").primaryKey()
var name = varchar("name", 255)
}
And doing the following:
Database.connect("jdbc:h2:mem:test", driver = "org.h2.Driver")
transaction {
SchemaUtils.create(Cities)
println(Cities.id.autoIncSeqName)
}
Prints:
07:19:05.969 [main] DEBUG Exposed - CREATE TABLE IF NOT EXISTS CITIES (ID INT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(255) NOT NULL)
null
The SchemaUtils.create
call should have generated a sequence though, right? And the autoIncSeqName
of the columns shouldnt be null
either…timm
02/11/2019, 6:26 AM