I’m seeing some puzzling behavior when I try to cr...
# exposed
m
I’m seeing some puzzling behavior when I try to create a table with an FK constraint on another table that is generated from an enum class. I have the following schema defined:
Copy code
enum class UserEventsEnum {
    LOGIN,
    LOGOUT,
    CHANGEPASS,
    CREATE,
    DISABLE,
    SETLICENSE,
    VALIDATE
}

object UserEvents : IntIdTable() {
    val type = enumerationByName("type", 32, UserEventsEnum::class.java)
}

object UserEventsHistory : IntIdTable() {
    val uid = reference("uid", Users.id).index()
    val time = datetime("time").default(DateTime.now(DateTimeZone.UTC)).index()
    val type = reference("type", UserEvents.id).index()
    val message = varchar("message", 256)
    val optional = varchar("optional", 256).nullable()
}