-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extremely simple migration system #23
Comments
Thinking about this further: the concept of migrations may end up being in direct conflict with the I'm going to forge ahead anyway and build this because I think it will be an interesting exploration, but it's very likely this turns out to be a bad idea in the long run! |
Migrations will run only if you open a database that previously existed (as opposed to opening a brand new empty database). This means that the first time you run a command against a fresh database, migrations will not run and the This also means that each migration needs to be able to sanity check the database to see if it should run or not. If it should NOT run, it will do nothing but still be marked as having executed by adding to the |
Needed for #12. This is going to be an incredibly simple version of the Django migration system.
migrations
table, keeping track of which migrations were applied (and when)migrate()
function which applies any pending migrationsMIGRATIONS
constant which is a list of functions to be appliedThe function names will be detected and used as the names of the migrations.
Every time you run the CLI tool it will call the
migrate()
function before doing anything else.Needs to take into account that there might be no tables at all. As such, migration functions should sanity check that the tables they are going to work on actually exist.
The text was updated successfully, but these errors were encountered: