SQLite Error while migration in KMM project

I am trying to perform migration in a KMM project.

As I can see migration is being well done in database, but I am getting this error:

WARNING: Secure coding is not enabled for restorable state! Enable
secure coding by implementing
NSApplicationDelegate.applicationSupportsSecureRestorableState: and
returning YES. org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or
missing database (no such column: Measurement.migrationTestField)

This is my migration File.

ALTER TABLE Measurement ADD COLUMN migrationTextField TEXT DEFAULT "Migration OK" NOT NULL;

And Measurement.sq

    import kotlin.Boolean;

CREATE TABLE IF NOT EXISTS Measurement (
    id TEXT NOT NULL,
    date TEXT NOT NULL,
    interfaceType TEXT NOT NULL,
    operator TEXT NOT NULL,
    status INTEGER NOT NULL,
    testType INTEGER NOT NULL,
    sent INTEGER AS Boolean NOT NULL DEFAULT 0,
    technology INTEGER NOT NULL,
    migrationTestField TEXT NOT NULL DEFAULT "Migration OK",
    PRIMARY KEY (id, date)
);

insertMeasurement:
INSERT INTO Measurement(
    id,
    date,
    interfaceType,
    operator,
    status,
    testType,
    sent,
    technology,
    migrationTestField
)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?);

updateMeasurement:
UPDATE Measurement
SET interfaceType = ?, operator = ?, status = ?, sent = ? WHERE id = ? AND date = ?;

selectMeasurementsGroupById:
SELECT * FROM Measurement GROUP BY id;

selectInProgressMeasurements:
SELECT * FROM Measurement WHERE status = 2;

selectPendingMeasurements:
SELECT * FROM Measurement WHERE sent = 0;

This is Table before migration

table before migration

After applying changes to project everything seems to be ok, running app and opening .db file again table is correctly modified.

enter image description here

various object updates

I am getting this error in jvm side

And this is my DatabaseManager Imp

internal actual class DatabaseDriverFactory {
companion object {
    private const val DATABASE_NAME = "any.db"
    val DATABASE_RELATIVE_PATH: String by lazy {
        val userHome = System.getProperty("user.home")
        userHome + File.separator + ".whatever" + File.separator + "data"
    }
    val DATABASE_URL = "jdbc:sqlite:$DATABASE_RELATIVE_PATH/$DATABASE_NAME"
}

actual fun createDriver(): SqlDriver {
    val properties = Properties().apply { put("foreign_keys", "true") }
    val driver: SqlDriver = JdbcSqliteDriver(DATABASE_URL, properties)
    initializeOrUpdateDatabase(driver)
    return driver
}

private fun initializeOrUpdateDatabase(driver: SqlDriver) {
    if (!databaseExists()) {
        createDatabaseRelativePath()
        initSchema(driver)
    } else {
        doMigration(driver)
    }
}

private fun initSchema(driver: SqlDriver) {
    val latestVersion = AgentDatabase.Schema.version
    val currentVersion = getCurrentDatabaseVersion(driver)
    Logger.debug("$TAG Database does not exist. Creating new database schema.")
    Logger.debug("$TAG Current DB Version: $currentVersion, Latest DB Version: $latestVersion")
    AgentDatabase.Schema.create(driver)
    if (currentVersion < latestVersion) doMigration(driver)
}

private fun doMigration(driver: SqlDriver) {
    val latestVersion = AgentDatabase.Schema.version
    while (getCurrentDatabaseVersion(driver) < latestVersion) {
        Logger.debug("$TAG Updating database schema from ${getCurrentDatabaseVersion(driver)} to $latestVersion.")
        try {
            AgentDatabase.Schema.migrate(driver, getCurrentDatabaseVersion(driver), latestVersion)
            updateDatabaseVersion(driver, getCurrentDatabaseVersion(driver) +1)
        } catch (exception: Exception) {
            updateDatabaseVersion(driver, getCurrentDatabaseVersion(driver) + 1)
        }
    }
}

private fun updateDatabaseVersion(driver: SqlDriver, newVersion: Long) {
    val jdbcDriver = driver as JdbcSqliteDriver
    jdbcDriver.getConnection().createStatement().use { statement ->
        statement.execute("PRAGMA user_version = $newVersion;")
    }
}

private fun getCurrentDatabaseVersion(driver: SqlDriver): Long {
    val jdbcDriver = driver as JdbcSqliteDriver
    val connection = jdbcDriver.getConnection()
    connection.createStatement().use { statement ->
        val resultSet = statement.executeQuery("PRAGMA user_version;")
        if (resultSet.next()) {
            return resultSet.getLong(1)
        }
    }
    return 0
}

private fun createDatabaseRelativePath() {
    val path = File(DATABASE_RELATIVE_PATH)
    if (!path.exists()) {
        path.mkdirs()
    }
}

private fun databaseExists(): Boolean {
    return File("$DATABASE_RELATIVE_PATH/$DATABASE_NAME").exists()
}

Migration logs seems to be ok.

13.05.2024 10:52:51.233 [AWT-EventQueue-0] DEBUG ROOT - DatabaseManager:  Updating database schema from 2 to 3.

I have no idea what I am doing wrong, Thanks for any help.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật