-
Notifications
You must be signed in to change notification settings - Fork 15
/
8079a1cb5874_.py
35 lines (27 loc) · 1.02 KB
/
8079a1cb5874_.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""empty message
Revision ID: 8079a1cb5874
Revises: 00c5cc87408d
Create Date: 2018-02-23 15:59:24.702040
"""
# revision identifiers, used by Alembic.
revision = '8079a1cb5874'
down_revision = '00c5cc87408d'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('tag')
op.add_column('article', sa.Column('tags', sa.PickleType(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('article', 'tags')
op.create_table('tag',
sa.Column('text', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('article_id', sa.INTEGER(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['article_id'], ['article.id'], name='tag_article_id_fkey', ondelete='CASCADE'),
sa.PrimaryKeyConstraint('text', 'article_id', name='tag_pkey')
)
# ### end Alembic commands ###