Skip to content

Proposition for a new architecture #40

@ewjoachim

Description

@ewjoachim

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions