mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-24 11:51:27 -08:00
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
|
"""user roles additional
|
||
|
|
||
|
Revision ID: 882e33231c5b
|
||
|
Revises: f1f0c854ae18
|
||
|
Create Date: 2023-10-18 22:10:16.602027
|
||
|
|
||
|
"""
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = '882e33231c5b'
|
||
|
down_revision = 'f1f0c854ae18'
|
||
|
branch_labels = None
|
||
|
depends_on = None
|
||
|
|
||
|
|
||
|
def upgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
with op.batch_alter_table('role_permission', schema=None) as batch_op:
|
||
|
batch_op.create_foreign_key(None, 'role', ['role_id'], ['id'])
|
||
|
|
||
|
with op.batch_alter_table('user', schema=None) as batch_op:
|
||
|
batch_op.drop_column('role')
|
||
|
|
||
|
# ### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
with op.batch_alter_table('user', schema=None) as batch_op:
|
||
|
batch_op.add_column(sa.Column('role', sa.INTEGER(), autoincrement=False, nullable=True))
|
||
|
|
||
|
with op.batch_alter_table('role_permission', schema=None) as batch_op:
|
||
|
batch_op.drop_constraint(None, type_='foreignkey')
|
||
|
|
||
|
# ### end Alembic commands ###
|