timelink.migrations package

timelink.migrations.autogenerate(db_url, message)[source]

Autogenerate migration script.

timelink.migrations.current(db_url, verbose=False)[source]

Get the current revision of the database.

timelink.migrations.downgrade(db_url, revision)[source]

Downgrade the database to the given revision.

timelink.migrations.get_versions(base='base', head='heads')[source]

Get the list of versions of the database.

Parameters:
  • base (str) – The base revision to start from.

  • head (str) – The head revision to stop at.

timelink.migrations.heads(db_url)[source]

Show heads of database

timelink.migrations.history(verbose=False)[source]

Show the migration history.

timelink.migrations.revision(db_url, message, autogenerate=False)[source]

Create a new revision.

timelink.migrations.set_db_url(db_url)[source]

Set the database URL in the alembic configuration.

This should be done before running any alembic commands in a specific database

timelink.migrations.stamp(db_url, revision: str)[source]

Stamp current revision to a given revision Use “heads” to mark the database as up-to-date

timelink.migrations.upgrade(db_url, revision='heads')[source]

Upgrade the database to a given revision (default most recent).

Submodules