I have a version table that has one column and just one row. This tracks what version of the database a client has. I then write a migration function that migrates from one version to the next. So I could have two functions MigrateFrom0To1, MigrateFrom1To2 and so on. Within my JS code I have a constant that says what database schema version this version of the code works with. Initially it would be 1. Each time I need to change the database structure, I increase the version number and add a new migration function.
Then at startup, I would run each migration function until I get to my target version. The last step of each migration would be to update the version record to represent the version I have migrated to. The very first launch of the app would have no version table and this would indicate you need to run the MigrateFrom0To1 function, which would create the version table and populate the single row.