17 lines
545 B
Kotlin
17 lines
545 B
Kotlin
package net.keinekekse.app.books.db.schema
|
|
|
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
|
import org.jetbrains.exposed.v1.dao.IntEntity
|
|
import org.jetbrains.exposed.v1.dao.IntEntityClass
|
|
|
|
object SamplerTable : IntIdTable("samplers") {
|
|
var bookId = reference("book_id", BooksTable.id).uniqueIndex()
|
|
}
|
|
|
|
class SamplerDAO(id: EntityID<Int>) : IntEntity(id) {
|
|
companion object : IntEntityClass<SamplerDAO>(SamplerTable)
|
|
|
|
var book by BookDAO referencedOn SamplerTable.bookId
|
|
}
|