This commit is contained in:
Iliyan Angelov
2025-11-18 18:35:46 +02:00
parent a1bd576540
commit ab832f851b
26 changed files with 8878 additions and 355 deletions

View File

@@ -0,0 +1,62 @@
"""add_page_content_table
Revision ID: 163657e72e93
Revises: 6a126cc5b23c
Create Date: 2025-11-18 18:02:03.480951
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '163657e72e93'
down_revision = '6a126cc5b23c'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
# Only create the page_contents table, skip other schema changes
op.create_table('page_contents',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('page_type', sa.Enum('home', 'contact', 'about', 'footer', 'seo', name='pagetype'), nullable=False),
sa.Column('title', sa.String(length=500), nullable=True),
sa.Column('subtitle', sa.String(length=1000), nullable=True),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('content', sa.Text(), nullable=True),
sa.Column('meta_title', sa.String(length=500), nullable=True),
sa.Column('meta_description', sa.Text(), nullable=True),
sa.Column('meta_keywords', sa.String(length=1000), nullable=True),
sa.Column('og_title', sa.String(length=500), nullable=True),
sa.Column('og_description', sa.Text(), nullable=True),
sa.Column('og_image', sa.String(length=1000), nullable=True),
sa.Column('canonical_url', sa.String(length=1000), nullable=True),
sa.Column('contact_info', sa.Text(), nullable=True),
sa.Column('social_links', sa.Text(), nullable=True),
sa.Column('footer_links', sa.Text(), nullable=True),
sa.Column('hero_title', sa.String(length=500), nullable=True),
sa.Column('hero_subtitle', sa.String(length=1000), nullable=True),
sa.Column('hero_image', sa.String(length=1000), nullable=True),
sa.Column('story_content', sa.Text(), nullable=True),
sa.Column('values', sa.Text(), nullable=True),
sa.Column('features', sa.Text(), nullable=True),
sa.Column('is_active', sa.Boolean(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('updated_at', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_page_contents_id'), 'page_contents', ['id'], unique=False)
op.create_index(op.f('ix_page_contents_page_type'), 'page_contents', ['page_type'], unique=True)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_page_contents_page_type'), table_name='page_contents')
op.drop_index(op.f('ix_page_contents_id'), table_name='page_contents')
op.drop_table('page_contents')
op.execute("DROP TYPE IF EXISTS pagetype")
# ### end Alembic commands ###

View File

@@ -0,0 +1,28 @@
"""add_map_url_to_page_content
Revision ID: cce764ef7a50
Revises: 163657e72e93
Create Date: 2025-11-18 18:11:41.071053
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cce764ef7a50'
down_revision = '163657e72e93'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
# Only add the map_url column to page_contents table
op.add_column('page_contents', sa.Column('map_url', sa.String(length=1000), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('page_contents', 'map_url')
# ### end Alembic commands ###