chore: import WonderQ project
This commit is contained in:
commit
f5a9e4403a
452 files changed
+34173
No files matched your search
@@ -0,0 +1,64 @@
|
||||
"""Add destination page configurable modules.
|
||||
|
||||
Revision ID: 0007_destination_page_modules
|
||||
Revises: 0006_hotel_group_offer_fields
|
||||
Create Date: 2026-07-07
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
revision = "0007_destination_page_modules"
|
||||
down_revision = "0006_hotel_group_offer_fields"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _create_destination_hero_table() -> None:
|
||||
op.create_table(
|
||||
"DestinationHero",
|
||||
sa.Column("id", sa.String(), nullable=False),
|
||||
sa.Column("title", sa.String(), nullable=False),
|
||||
sa.Column("kicker", sa.String(), nullable=True),
|
||||
sa.Column("image", sa.String(), nullable=True),
|
||||
sa.Column("sortOrder", sa.Integer(), nullable=False, server_default="0"),
|
||||
sa.Column("isActive", sa.Boolean(), nullable=False, server_default=sa.true()),
|
||||
sa.Column("createdAt", sa.DateTime(), nullable=False),
|
||||
sa.Column("updatedAt", sa.DateTime(), nullable=False),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
|
||||
|
||||
def _create_destination_region_table() -> None:
|
||||
op.create_table(
|
||||
"DestinationRegion",
|
||||
sa.Column("id", sa.String(), nullable=False),
|
||||
sa.Column("label", sa.String(), nullable=False),
|
||||
sa.Column("keyword", sa.String(), nullable=True),
|
||||
sa.Column("spots", sa.Text(), nullable=True),
|
||||
sa.Column("sortOrder", sa.Integer(), nullable=False, server_default="0"),
|
||||
sa.Column("isActive", sa.Boolean(), nullable=False, server_default=sa.true()),
|
||||
sa.Column("createdAt", sa.DateTime(), nullable=False),
|
||||
sa.Column("updatedAt", sa.DateTime(), nullable=False),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
bind = op.get_bind()
|
||||
existing_tables = set(inspect(bind).get_table_names())
|
||||
if "DestinationHero" not in existing_tables:
|
||||
_create_destination_hero_table()
|
||||
if "DestinationRegion" not in existing_tables:
|
||||
_create_destination_region_table()
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
bind = op.get_bind()
|
||||
existing_tables = set(inspect(bind).get_table_names())
|
||||
if "DestinationRegion" in existing_tables:
|
||||
op.drop_table("DestinationRegion")
|
||||
if "DestinationHero" in existing_tables:
|
||||
op.drop_table("DestinationHero")
|
||||
Reference in new issue
Block a user