open-law/migrations/versions/96995454b90d_ordering.py

39 lines
1.0 KiB
Python
Raw Normal View History

2023-06-01 14:01:45 +00:00
"""ordering
Revision ID: 96995454b90d
Revises: 79e8c7bff9c9
Create Date: 2023-06-01 17:01:00.877443
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "96995454b90d"
down_revision = "79e8c7bff9c9"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("collections", schema=None) as batch_op:
batch_op.add_column(sa.Column("position", sa.Integer(), nullable=True))
with op.batch_alter_table("sections", schema=None) as batch_op:
batch_op.add_column(sa.Column("position", sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("sections", schema=None) as batch_op:
batch_op.drop_column("position")
with op.batch_alter_table("collections", schema=None) as batch_op:
batch_op.drop_column("position")
# ### end Alembic commands ###