blog/migrations/versions/40f7b6561b4a_002.py

41 lines
1.2 KiB
Python
Raw Permalink Normal View History

2021-05-15 01:04:17 +02:00
"""002
Revision ID: 40f7b6561b4a
Revises: d091fbf48f6f
Create Date: 2021-05-15 00:35:30.800690
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '40f7b6561b4a'
down_revision = 'd091fbf48f6f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('permission',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('uuid', sa.Unicode(), nullable=True),
sa.Column('subject', sa.UnicodeText(), nullable=True),
sa.Column('subject_id', sa.Integer(), nullable=True),
sa.Column('action', sa.UnicodeText(), nullable=True),
sa.Column('object', sa.UnicodeText(), nullable=True),
sa.Column('object_id', sa.Integer(), nullable=True),
sa.Column('is_allowed', sa.Boolean(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_permission_uuid'), 'permission', ['uuid'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_permission_uuid'), table_name='permission')
op.drop_table('permission')
# ### end Alembic commands ###