migrations/versions/cbf72dcb80e3_.py
"""empty message
Revision ID: cbf72dcb80e3
Revises: affad812c947
Create Date: 2016-08-28 05:28:27.337759
"""
# revision identifiers, used by Alembic.
revision = 'cbf72dcb80e3'
down_revision = 'affad812c947'
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('custom_sys_role',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(), nullable=True),
sa.Column('title', sa.String(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.add_column(u'panel_permissions', sa.Column('role_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'panel_permissions', 'custom_sys_role', ['role_id'], ['id'])
op.drop_column(u'panel_permissions', 'role_name')
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column(u'panel_permissions', sa.Column('role_name', sa.VARCHAR(), autoincrement=False, nullable=True))
op.drop_constraint(None, 'panel_permissions', type_='foreignkey')
op.drop_column(u'panel_permissions', 'role_id')
op.drop_table('custom_sys_role')
### end Alembic commands ###