"""eliminations and substitutions

Revision ID: 7123375920d1
Revises: 8008c59dddd5
Create Date: 2025-08-07 20:00:32.512764

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '7123375920d1'
down_revision: Union[str, None] = '8008c59dddd5'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('keyword_spreads',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('keyword', sa.String(), nullable=False),
    sa.Column('region_code', sa.String(length=100), nullable=True),
    sa.Column('keyword_type', sa.String(length=100), nullable=True),
    sa.Column('date_created', sa.DateTime(), nullable=True),
    sa.Column('last_updated', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_keyword_spreads_id'), 'keyword_spreads', ['id'], unique=False)
    op.create_table('keyword_substitutions',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('keyword', sa.String(), nullable=False),
    sa.Column('substitution', sa.String(), nullable=True),
    sa.Column('substitution_type', sa.String(length=100), nullable=True),
    sa.Column('date_created', sa.DateTime(), nullable=True),
    sa.Column('last_updated', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_keyword_substitutions_id'), 'keyword_substitutions', ['id'], unique=False)
    op.create_table('vintages',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=255), nullable=False),
    sa.Column('date_created', sa.DateTime(), nullable=True),
    sa.Column('last_updated', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_vintages_id'), 'vintages', ['id'], unique=False)
    op.create_table('word_aliases',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('word', sa.String(), nullable=False),
    sa.Column('alias', sa.String(), nullable=False),
    sa.Column('alias_type', sa.String(length=100), nullable=True),
    sa.Column('date_created', sa.DateTime(), nullable=True),
    sa.Column('last_updated', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_word_aliases_id'), 'word_aliases', ['id'], unique=False)
    op.create_table('word_eliminations',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('word', sa.String(), nullable=False),
    sa.Column('elimination_type', sa.String(length=100), nullable=True),
    sa.Column('date_created', sa.DateTime(), nullable=True),
    sa.Column('last_updated', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_word_eliminations_id'), 'word_eliminations', ['id'], unique=False)
    op.create_table('word_reserved',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('word', sa.String(), nullable=False),
    sa.Column('reserved_type', sa.String(length=100), nullable=True),
    sa.Column('date_created', sa.DateTime(), nullable=True),
    sa.Column('last_updated', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_word_reserved_id'), 'word_reserved', ['id'], unique=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_word_reserved_id'), table_name='word_reserved')
    op.drop_table('word_reserved')
    op.drop_index(op.f('ix_word_eliminations_id'), table_name='word_eliminations')
    op.drop_table('word_eliminations')
    op.drop_index(op.f('ix_word_aliases_id'), table_name='word_aliases')
    op.drop_table('word_aliases')
    op.drop_index(op.f('ix_vintages_id'), table_name='vintages')
    op.drop_table('vintages')
    op.drop_index(op.f('ix_keyword_substitutions_id'), table_name='keyword_substitutions')
    op.drop_table('keyword_substitutions')
    op.drop_index(op.f('ix_keyword_spreads_id'), table_name='keyword_spreads')
    op.drop_table('keyword_spreads')
    # ### end Alembic commands ###
