引用外键数组jetbrains.exposed.sql

时间:2018-10-04 16:33:07

标签: sql kotlin jetbrains-ide ktor kotlin-exposed

我有台歌和台词。歌曲可以包含更多流派。所以我想从表类型中引用genreIds。如何在jetbrains.exposed.sql中引用外键数组? 语法(integer("genre_id") references GenreTable.id)仅供参考。有想法吗?

object SongTable : Table() {
    val id       = integer("id").primaryKey().autoIncrement()
    val name     = text("name")
    val genreIds = (integer("genre_id") references GenreTable.id) //THERE I WANT MORE IDS 
}

object GenreTable : Table() {
    val id    = integer("id").primaryKey().autoIncrement()
    val logo  = text("logo")
}

0 个答案:

没有答案