refugee.migration

Here we define the API for migrations.

Classically, a migration has two methods which a user may call, up and down. These will be retained. In addition, there are two optional methods which will get run on all migrations, check and pre-flight. These must be overridden in a subclass to have any effect

class refugee.migration.Migration[source]

The API described below is enforced by the Migration Manager.

Only down() and up() are absolutely required.

The optional check() and preflight() are called in order to assist with the migration.

The life-cycle of a migration goes as follows:

:py:func:`.preflight` -> (:py:func:`.up` | :py:func:`.down`) -> :py:func:`.check`
check(connection)[source]

Ensures that a given migration ran successfully

down(connection)[source]

Called when Direction.DOWN == True

preflight(connection)[source]

Operations to run before self.up is run

up(connection)[source]

Called when Direction.UP == True

exception refugee.migration.MigrationError[source]

Raised when a Migration Fails

exception refugee.migration.RegistryLocked[source]

Raised when the registration is locked and attempted to be modified

exception refugee.migration.UnknowDirectionError[source]

Raised when an unknown migration direction is given

class refugee.migration.registry[source]

Lame attempt at a locking registry

Previous topic

refugee.manager

This Page