Closed MarkL4YG closed 5 years ago
Note to self: Rebase the sql-refractor
onto develop
branch after this has been merged and open another PR for that.
As suggested in private conversations, I'll be closing this PR. It will be replaced with a MVP implementation of the refactor.
This pull request includes:
MigrationManager
which already has some methods it is going to need in the future.Migrator
class from which all migrators will inherit.DBMigrator
class from which all db migrators will inherit which provides many utility methods for working with the tables/schema.LegacyDBMigrator
which will migrate the existing database schema to the new one.Of course, since this is yet another update of the big thing, this code is not yet runnable.
The basic idea behind migrators
The
MigrationManager
determines which migrations to run based on the current schema version and whether or not the schema has already been initialized. This can be used for both the file and DB storage.Migrators then - well - migrate the data to the latest version from whatever version currently is used.
Notes
TEMigrationException
will serve an important role in future code updates (e.g. triggering rollbacks when things go wrong).legacy
tolatest
.