is there anything i have to do to get exposed to c...
# exposed
t
is there anything i have to do to get exposed to call a sequence for id generation besides declating the id column as follows?
Copy code
override val id: Column<EntityID<Long>> = long("id").autoIncrement("hibernate_sequence").primaryKey().entityId()
These seems to be either a bug or a missing feature? creating a table like:
Copy code
object Cities : Table() {
    val id = integer("id").autoIncrement("my_sequence").primaryKey()
    var name = varchar("name", 255)
}
And doing the following:
Copy code
Database.connect("jdbc:h2:mem:test", driver = "org.h2.Driver")
    transaction {
        SchemaUtils.create(Cities)
        println(Cities.id.autoIncSeqName)
    }
Prints:
Copy code
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…
Ohh… the autoninc sequence only works for certain dialects… i will open an issue then
👍 1