eh missing shit from last commit

This commit is contained in:
Aria Moradi 2021-02-04 00:38:23 +03:30
parent d766206343
commit 8f28c3b74b
2 changed files with 3 additions and 4 deletions

View File

@ -79,7 +79,6 @@ dependencies {
implementation ("org.jetbrains.exposed:exposed-core:$exposed_version") implementation ("org.jetbrains.exposed:exposed-core:$exposed_version")
implementation ("org.jetbrains.exposed:exposed-dao:$exposed_version") implementation ("org.jetbrains.exposed:exposed-dao:$exposed_version")
implementation ("org.jetbrains.exposed:exposed-jdbc:$exposed_version") implementation ("org.jetbrains.exposed:exposed-jdbc:$exposed_version")
implementation ("org.xerial:sqlite-jdbc:3.30.1")
implementation ("com.h2database:h2:1.4.199") implementation ("com.h2database:h2:1.4.199")

View File

@ -16,14 +16,14 @@ import org.jetbrains.exposed.sql.transactions.transaction
object DBMangaer { object DBMangaer {
val db by lazy { val db by lazy {
Database.connect("jdbc:h2:${Config.dataRoot}/database.h2", "org.h2.Driver") Database.connect("jdbc:h2:${Config.dataRoot}/database.h2", "org.h2.Driver")
// Database.connect("jdbc:sqlite:${Config.dataRoot}/database.sqlite3", "org.sqlite.JDBC")
} }
} }
fun makeDataBaseTables() { fun makeDataBaseTables() {
// mention db object to connect // mention db object to connect
val db = DBMangaer.db DBMangaer.db
db.useNestedTransactions = true // val db = DBMangaer.db
// db.useNestedTransactions = true
transaction { transaction {
SchemaUtils.create(ExtensionsTable) SchemaUtils.create(ExtensionsTable)