pyproger/migrations/versions/5e6d181b4b74_.py

35 lines
912 B
Python

"""empty message
Revision ID: 5e6d181b4b74
Revises: e24055e16b26
Create Date: 2023-10-04 08:46:50.473590
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5e6d181b4b74'
down_revision = 'e24055e16b26'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('page', schema=None) as batch_op:
batch_op.add_column(sa.Column('update_datetime', sa.DateTime(), nullable=True))
batch_op.create_unique_constraint(None, ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('page', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
batch_op.drop_column('update_datetime')
# ### end Alembic commands ###