diff --git a/migrations/versions/8079a1cb5874_.py b/migrations/versions/8079a1cb5874_.py new file mode 100644 index 000000000..7119f6b31 --- /dev/null +++ b/migrations/versions/8079a1cb5874_.py @@ -0,0 +1,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 ###