хранение статик страниц в бд и их редактировани из админки. автоматическое создание ссылок на них на страницах
This commit is contained in:
42
migrations/versions/e24055e16b26_.py
Normal file
42
migrations/versions/e24055e16b26_.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""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 ###
|
Reference in New Issue
Block a user