44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
"""AddA_col_Notifyed_Bool
|
|
|
|
Revision ID: 04e41f293ec2
|
|
Revises: 902a6851ae27
|
|
Create Date: 2024-01-08 21:11:13.952001
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '04e41f293ec2'
|
|
down_revision = '902a6851ae27'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('user_event', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('notified', sa.Boolean(), nullable=True))
|
|
batch_op.alter_column('user_id',
|
|
existing_type=sa.VARCHAR(length=36),
|
|
nullable=False)
|
|
batch_op.alter_column('event_id',
|
|
existing_type=sa.INTEGER(),
|
|
nullable=False)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('user_event', schema=None) as batch_op:
|
|
batch_op.alter_column('event_id',
|
|
existing_type=sa.INTEGER(),
|
|
nullable=True)
|
|
batch_op.alter_column('user_id',
|
|
existing_type=sa.VARCHAR(length=36),
|
|
nullable=True)
|
|
batch_op.drop_column('notified')
|
|
|
|
# ### end Alembic commands ###
|