55 lines
2.3 KiB
Python
55 lines
2.3 KiB
Python
"""Quay releases
|
|
|
|
Revision ID: 1c0f6ede8992
|
|
Revises: 545794454f49
|
|
Create Date: 2015-09-15 15:46:09.784607
|
|
|
|
"""
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '1c0f6ede8992'
|
|
down_revision = '545794454f49'
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
def upgrade(tables):
|
|
### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('quayregion',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('name', sa.String(length=255), nullable=False),
|
|
sa.PrimaryKeyConstraint('id', name=op.f('pk_quayregion'))
|
|
)
|
|
op.create_index('quayregion_name', 'quayregion', ['name'], unique=True)
|
|
op.create_table('quayservice',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('name', sa.String(length=255), nullable=False),
|
|
sa.PrimaryKeyConstraint('id', name=op.f('pk_quayservice'))
|
|
)
|
|
op.create_index('quayservice_name', 'quayservice', ['name'], unique=True)
|
|
op.create_table('quayrelease',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('service_id', sa.Integer(), nullable=False),
|
|
sa.Column('version', sa.String(length=255), nullable=False),
|
|
sa.Column('region_id', sa.Integer(), nullable=False),
|
|
sa.Column('reverted', sa.Boolean(), nullable=False),
|
|
sa.Column('created', sa.DateTime(), nullable=False),
|
|
sa.ForeignKeyConstraint(['region_id'], ['quayregion.id'], name=op.f('fk_quayrelease_region_id_quayregion')),
|
|
sa.ForeignKeyConstraint(['service_id'], ['quayservice.id'], name=op.f('fk_quayrelease_service_id_quayservice')),
|
|
sa.PrimaryKeyConstraint('id', name=op.f('pk_quayrelease'))
|
|
)
|
|
op.create_index('quayrelease_created', 'quayrelease', ['created'], unique=False)
|
|
op.create_index('quayrelease_region_id', 'quayrelease', ['region_id'], unique=False)
|
|
op.create_index('quayrelease_service_id', 'quayrelease', ['service_id'], unique=False)
|
|
op.create_index('quayrelease_service_id_region_id_created', 'quayrelease', ['service_id', 'region_id', 'created'], unique=False)
|
|
op.create_index('quayrelease_service_id_version_region_id', 'quayrelease', ['service_id', 'version', 'region_id'], unique=True)
|
|
### end Alembic commands ###
|
|
|
|
|
|
def downgrade(tables):
|
|
### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('quayrelease')
|
|
op.drop_table('quayservice')
|
|
op.drop_table('quayregion')
|
|
### end Alembic commands ###
|