yasuki_core.accounts.migrate.apply_migrations#

apply_migrations(conn)[source]#

Apply every migration not yet recorded in schema_migrations, in order, on conn.

Each migration runs in its own transaction and is recorded only on success, so a failure leaves the database at the last good version and a re-run resumes from there. Already-applied migrations are skipped, so this is safe to run on every deploy. migrate wraps this with a real connection; a caller may pass its own.

Parameters:
connpsycopg.Connection

An open connection, expected in autocommit mode; each migration is wrapped in its own explicit transaction.

Returns:
appliedlist of str

The versions applied by this call, in order. Empty when the database is already current.