33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
"""init
|
|
|
|
Revision ID: de7d23a4b139
|
|
Revises: 85284752d1d5
|
|
Create Date: 2022-05-01 08:41:03.244262
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'de7d23a4b139'
|
|
down_revision = '85284752d1d5'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column('tags', sa.Column('tag_name', sa.Unicode(length=25), nullable=False))
|
|
op.create_unique_constraint(op.f('uq_tags_tag_name'), 'tags', ['tag_name'])
|
|
op.add_column('topics', sa.Column('topic_name', sa.Unicode(length=25), nullable=False))
|
|
op.create_unique_constraint(op.f('uq_topics_topic_name'), 'topics', ['topic_name'])
|
|
# ### end Alembic commands ###
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint(op.f('uq_topics_topic_name'), 'topics', type_='unique')
|
|
op.drop_column('topics', 'topic_name')
|
|
op.drop_constraint(op.f('uq_tags_tag_name'), 'tags', type_='unique')
|
|
op.drop_column('tags', 'tag_name')
|
|
# ### end Alembic commands ###
|