Hello. `verifyCommonMainDatabaseMigration` starts ...
# squarelibraries
v
Hello.
verifyCommonMainDatabaseMigration
starts taking lots of time to run, 10 minutes+. I have history of db schemas in the schemas folder (1-5), is it because it runs all the required migrations for all schemas? Aka for schema 4 it will run 1-3 migration and so on? If that is the case then is there are any reasons to keep old schemas which are already tested and released, except the last one in prod?
j
by "history of schemas" do you mean the .db files for them?
or the .sqm files?
v
.db files of course. We need .sqm because user can update from 1 (old app) to current 10 and all migrations will run
j
Okay. You only need a single .db file for the oldest database version that you still support. SQL Delight will run each migration after that number on that file to ensure it can be fully migrated to the latest. Having additional .db files is redundant, and slows down the verification since it becomes exponential.
v
Only single? E.g. if we have in prod version 10 and developing changes. So we add 10.sqm file with new added changes, we run generateSchema so 11.db created. And on this point we have both 10 and 11 and we start doing verifyMigration?
j
You only need a .db file for the lowest version you support, so like 1.db
v
ah
j
Then when you add 11.sqm it will automatically be verified
v
only the lowest and current. Makes sense. Thank you
Wait I don't need "current'. The only latest oldest we support. The current it takes from the .sq files in the project anyway?
j
correct!
v
Where you were year ago.. I know you were here but yeah