When working with SQLDelight migrations, I have se...
# squarelibraries
h
When working with SQLDelight migrations, I have set up migration to execute using the following code:
Copy code
Database.Schema.migrate(
    driver = driver,
    oldVersion = 0,
    newVersion = Database.Schema.version,
)
I assume that this won't work if the user is currently on version 2, and I am trying to migrate to version 3. I assume that I have to check which version of the database the user is currently on and only execute migration if it is lower than the latest version. If that's the case, how can I check the current database-verison that the user is on? (Also, If this is the wrong way to handle migrations, please elaborate).
p
Iirc this is handled automatically
h
You are correct. I stopped attempting to do the migration by code and it works as expected now.