Skip to content

Commit

Permalink
fix: fix a bug related to the fact that tables were not created when …
Browse files Browse the repository at this point in the history
…starting the application
  • Loading branch information
SurfaceYellowDuck committed May 1, 2023
1 parent 7ebf862 commit 360080d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions trees/src/main/kotlin/bst/db/controllers/SQLController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class SQLController : Controller<BSTNode<Int, String>, BSTree<Int, String>> {
user = "test",
password = "test-test"
)
createTables()
}

override fun removeTree(treeName: String) {
Expand Down Expand Up @@ -56,8 +57,10 @@ class SQLController : Controller<BSTNode<Int, String>, BSTree<Int, String>> {
}

private fun createTables() {
SchemaUtils.create(Trees)
SchemaUtils.create(Nodes)
transaction {
SchemaUtils.create(Trees)
SchemaUtils.create(Nodes)
}
}

private fun SerializableNode.toNodeDao(treeDao: Tree): Node {
Expand Down

0 comments on commit 360080d

Please sign in to comment.