each version migration is a function that takes a record in an old state a migrates it to a new one.
once you read a record from the db that has an outdated version number you run all the pending migrations and then save.
with this scheme your application code only has to know how to deal with the latest schema version. all the rest is handled by migrations.
each version migration is a function that takes a record in an old state a migrates it to a new one.
once you read a record from the db that has an outdated version number you run all the pending migrations and then save.
with this scheme your application code only has to know how to deal with the latest schema version. all the rest is handled by migrations.