drydock/alembic/versions/9593a123e7c5_create_base_database_tables.py
Scott Hussey cff7420cff Support links for task status
- Some status changes in a task may have additional information that
  is referenced by a URI link. Support describing these links and
  returning them via API.
- Refactor alembic stuff to better handle table schema updates
- Add unit tests

Change-Id: Iae63a9716f2522578be0244925fc274a4338eac4
2018-07-27 20:16:24 -05:00

38 lines
1.1 KiB
Python

"""create base database tables
Revision ID: 9593a123e7c5
Revises:
Create Date: 2017-09-21 14:56:13.866443
"""
# revision identifiers, used by Alembic.
revision = '9593a123e7c5'
down_revision = None
branch_labels = None
depends_on = None
from alembic import op
from drydock_provisioner.statemgmt.db import tables
def upgrade():
op.create_table(tables.Tasks.__tablename__, *tables.Tasks.__baseschema__)
op.create_table(tables.ResultMessage.__tablename__,
*tables.ResultMessage.__baseschema__)
op.create_table(tables.ActiveInstance.__tablename__,
*tables.ActiveInstance.__baseschema__)
op.create_table(tables.BootAction.__tablename__,
*tables.BootAction.__baseschema__)
op.create_table(tables.BootActionStatus.__tablename__,
*tables.BootActionStatus.__baseschema__)
def downgrade():
op.drop_table(tables.Tasks.__tablename__)
op.drop_table(tables.ResultMessage.__tablename__)
op.drop_table(tables.ActiveInstance.__tablename__)
op.drop_table(tables.BootAction.__tablename__)
op.drop_table(tables.BootActionStatus.__tablename__)