37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
"""Add user role, remove about_me
|
|
|
|
Revision ID: 8e48199f1417
|
|
Revises: 7736bc740f9b
|
|
Create Date: 2023-03-18 21:18:21.923362
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '8e48199f1417'
|
|
down_revision = '7736bc740f9b'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### 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.String(length=32), nullable=True))
|
|
batch_op.create_index(batch_op.f('ix_user_role'), ['role'], unique=False)
|
|
batch_op.drop_column('about_me')
|
|
|
|
# ### 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('about_me', sa.VARCHAR(length=140), nullable=True))
|
|
batch_op.drop_index(batch_op.f('ix_user_role'))
|
|
batch_op.drop_column('role')
|
|
|
|
# ### end Alembic commands ###
|