blog/migrations/versions/28f9ab4fc8b0_002.py

41 lines
1.2 KiB
Python
Raw Normal View History

2020-07-08 14:36:13 +02:00
"""002
Revision ID: 28f9ab4fc8b0
Revises: d08a068031c3
Create Date: 2020-07-08 14:27:11.649888
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '28f9ab4fc8b0'
down_revision = 'd08a068031c3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('blog_post',
sa.Column('created_dt', sa.UnicodeText(), nullable=True),
sa.Column('updated_dt', sa.UnicodeText(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('uuid', sa.Unicode(), nullable=True),
sa.Column('filename', sa.UnicodeText(), nullable=True),
sa.Column('body', sa.UnicodeText(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_blog_post_uuid'), 'blog_post', ['uuid'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_blog_post_uuid'), table_name='blog_post')
op.drop_table('blog_post')
# ### end Alembic commands ###