#16 Added "role" required field for register endpoint

This commit is contained in:
2023-03-18 21:19:33 -04:00
parent ec60eb3117
commit ea35d81641
3 changed files with 46 additions and 7 deletions

View File

@@ -0,0 +1,36 @@
"""empty message
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 ###