pyproger/migrations/versions/e24055e16b26_.py

43 lines
1.2 KiB
Python
Raw Normal View History

"""empty message
Revision ID: e24055e16b26
Revises: 8c415e462cb3
Create Date: 2023-10-02 09:30:10.566908
"""
import flask_security
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "e24055e16b26"
down_revision = "8c415e462cb3"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"page",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("name", sa.String(length=20), nullable=True),
sa.Column("slug", sa.String(length=50), nullable=False),
sa.Column("text", sa.Text(), nullable=True),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("id"),
)
with op.batch_alter_table("post", schema=None) as batch_op:
batch_op.create_unique_constraint(None, ["id"])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("post", schema=None) as batch_op:
batch_op.drop_constraint(None, type_="unique")
op.drop_table("page")
# ### end Alembic commands ###