
Alembic migrations were introduced to Barbican a while ago but have not been used recently. This CR revisits the migration logic and ensures that time-zero database tables creation is distinguished from Alembic-base schema updates. The associated database migration script is also revived, allowing for schema migrations outside of the Barbican boot process. Change-Id: I3e7fd7ac3f629da18329c22ad11cb9ccc1b7f9f9 Implements: blueprint db-revive-migrations
58 lines
1.3 KiB
INI
58 lines
1.3 KiB
INI
# A generic, single database configuration
|
|
|
|
[alembic]
|
|
# path to migration scripts
|
|
script_location = %(here)s/alembic_migrations
|
|
|
|
# template used to generate migration files
|
|
# file_template = %%(rev)s_%%(slug)s
|
|
|
|
# set to 'true' to run the environment during
|
|
# the 'revision' command, regardless of autogenerate
|
|
# revision_environment = false
|
|
|
|
# default to an empty string because the Barbican migration process will
|
|
# extract the correct value and set it programatically before alembic is fully
|
|
# invoked.
|
|
sqlalchemy.url =
|
|
#sqlalchemy.url = driver://user:pass@localhost/dbname
|
|
#sqlalchemy.url = sqlite:///barbican.sqlite
|
|
#sqlalchemy.url = sqlite:////var/lib/barbican/barbican.sqlite
|
|
#sqlalchemy.url = postgresql+psycopg2://postgres:postgres@localhost:5432/barbican_api
|
|
|
|
# Logging configuration
|
|
[loggers]
|
|
keys = alembic
|
|
#keys = root,sqlalchemy,alembic
|
|
|
|
[handlers]
|
|
keys = console
|
|
|
|
[formatters]
|
|
keys = generic
|
|
|
|
[logger_root]
|
|
level = DEBUG
|
|
handlers = console
|
|
qualname =
|
|
|
|
[logger_sqlalchemy]
|
|
level = DEBUG
|
|
handlers =
|
|
qualname = sqlalchemy.engine
|
|
|
|
[logger_alembic]
|
|
level = INFO
|
|
handlers =
|
|
qualname = alembic
|
|
|
|
[handler_console]
|
|
class = StreamHandler
|
|
args = (sys.stderr,)
|
|
level = NOTSET
|
|
formatter = generic
|
|
|
|
[formatter_generic]
|
|
format = %(levelname)-5.5s [%(name)s] %(message)s
|
|
datefmt = %H:%M:%S
|