Added registration migration
This commit is contained in:
41
migrations/versions/5dfa048b8215_added_registrations.py
Normal file
41
migrations/versions/5dfa048b8215_added_registrations.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""added registrations
|
||||
|
||||
Revision ID: 5dfa048b8215
|
||||
Revises: 294a2085f840
|
||||
Create Date: 2021-09-22 19:35:23.584306
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '5dfa048b8215'
|
||||
down_revision = '294a2085f840'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('registration',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=False),
|
||||
sa.Column('routing_key', sa.String(length=255), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('name')
|
||||
)
|
||||
op.create_table('registration_target',
|
||||
sa.Column('registration', sa.Integer(), nullable=True),
|
||||
sa.Column('target', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['registration'], ['target.id'], ),
|
||||
sa.ForeignKeyConstraint(['target'], ['registration.id'], )
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('registration_target')
|
||||
op.drop_table('registration')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user