congress.db.migration package

Module contents

congress.db.migration.alter_column_if_exists(table_name, column_name, **kwargs)

Alter a column only if it exists in the schema.

congress.db.migration.alter_enum(table, column, enum_type, nullable)
congress.db.migration.create_table_if_not_exist_psql(table_name, values)
congress.db.migration.drop_table_if_exists(table_name)
congress.db.migration.raise_if_offline(func)

Decorator for raising if a function is called in offline mode.

congress.db.migration.rename_table_if_exists(old_table_name, new_table_name)
congress.db.migration.schema_has_column(table_name, column_name)

Check whether the specified column exists in the current schema.

This method cannot be executed in offline mode.

congress.db.migration.schema_has_table(table_name)

Check whether the specified table exists in the current schema.

This method cannot be executed in offline mode.

congress.db.migration.skip_if_offline(func)

Decorator for skipping migrations in offline mode.