from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
revision = '163657e72e93'
down_revision = '6a126cc5b23c'
branch_labels = None
depends_on = None

def upgrade() -> None:
    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)

def downgrade() -> None:
    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')