I'm using MySQL database, and have this code for m...
# squarelibraries
I'm using MySQL database, and have this code for migration:
Copy code
val dataSource = HikariDataSource(datasourceConfig)
val driver = dataSource.asJdbcDriver()
private class SqlDriverTransacter(driver: SqlDriver) : TransacterImpl(driver)

fun SqlDriver.migrate(schema: SqlDriver.Schema) {
    val sqlDriverTransacter = SqlDriverTransacter(this)
    // ...
    sqlDriverTransacter.transaction {
    	// ...
I don't remember exactly where from this code came from, it looks kind of like this one. The problem is that in case of a crash inside
, the database is not getting rolled back. When in my migration I have
create table
and then some action, if the action fails, next time I'm getting a crash
Table already exists
. I've tried catching the error inside
and running
manually, but this had no effect.
definitely sounds like a bug, we should add a test to the drivers that verifies a created table is rolled back if theres a crash in the transaction