-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Here's what we would do in septentrion migrate
, in order.
The idea is that as much as possible, we avoid mixing decision making and I/O.
- Create the migration table if not exsists
- Read existing migrations in the DB
- Read existing migration versions and filenames in the file system
- Decide whether to initialize the DB with a schema
- Compute the list of migrations to run
migrate(fixtures before schema)
migrate(schema)
migrate(fixtures after schema)
- For each migration:
- Fake it if boolean says to fake it or
migrate(migration)
- Write the migration in the table as executed
def migrate(migration):
- Read the migration file content
- Parse the migration (meta, sqlparse statements, clean (
\timing
), etc) - For each statement (including meta loops):
- Execute it
Metadata
Metadata
Assignees
Labels
No labels