mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-06-18 07:45:13 +00:00
11 lines
346 B
Kotlin
11 lines
346 B
Kotlin
package dev.inmo.micro_utils.repos.exposed
|
|
|
|
import org.jetbrains.exposed.sql.*
|
|
import org.jetbrains.exposed.sql.transactions.transaction
|
|
|
|
fun Table.initTable(database: Database) {
|
|
transaction(database) { SchemaUtils.createMissingTablesAndColumns(this@initTable) }
|
|
}
|
|
|
|
fun <T> T.initTable() where T: ExposedRepo, T: Table = initTable(database)
|