"""appearance theme 

Revision ID: f4a00330c096
Revises: 75bd3b8213a0
Create Date: 2025-05-24 14:45:34.773719

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = 'f4a00330c096'
down_revision: Union[str, None] = '75bd3b8213a0'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('appearance_theme_settings',
    sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False),
    sa.Column('primary_color', sa.String(), nullable=False),
    sa.Column('background_color', sa.String(), nullable=False),
    sa.Column('font_color', sa.String(), nullable=False),
    sa.Column('font_size', sa.Enum('SMALL', 'MEDIUM', 'LARGE', name='fontsizeenum'), nullable=False),
    sa.Column('font_family', sa.String(), nullable=False),
    sa.Column('company_id', sa.String(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.drop_index('ix_general_ledger_id', table_name='general_ledger')
    op.drop_table('general_ledger')
    op.drop_index('ix_gl_account_master_id', table_name='gl_account_master')
    op.drop_table('gl_account_master')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('gl_account_master',
    sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
    sa.Column('general_ledger_number', sa.NUMERIC(precision=50, scale=0), autoincrement=False, nullable=False),
    sa.Column('account_name', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
    sa.Column('category', sa.VARCHAR(length=50), autoincrement=False, nullable=False),
    sa.Column('created_at', postgresql.TIMESTAMP(timezone=True), server_default=sa.text('now()'), autoincrement=False, nullable=False),
    sa.Column('updated_at', postgresql.TIMESTAMP(timezone=True), server_default=sa.text('now()'), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('id', name='gl_account_master_pkey'),
    sa.UniqueConstraint('general_ledger_number', name='gl_account_master_general_ledger_number_key')
    )
    op.create_index('ix_gl_account_master_id', 'gl_account_master', ['id'], unique=False)
    op.create_table('general_ledger',
    sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
    sa.Column('date', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
    sa.Column('general_ledger_number', sa.NUMERIC(precision=50, scale=0), autoincrement=False, nullable=False),
    sa.Column('account_name', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
    sa.Column('category', sa.VARCHAR(length=50), autoincrement=False, nullable=False),
    sa.Column('description', sa.VARCHAR(length=500), autoincrement=False, nullable=True),
    sa.Column('debit', sa.NUMERIC(precision=15, scale=2), autoincrement=False, nullable=False),
    sa.Column('credit', sa.NUMERIC(precision=15, scale=2), autoincrement=False, nullable=False),
    sa.Column('entry_by', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
    sa.Column('entry_system_source', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
    sa.Column('created_at', postgresql.TIMESTAMP(timezone=True), server_default=sa.text('now()'), autoincrement=False, nullable=False),
    sa.Column('updated_at', postgresql.TIMESTAMP(timezone=True), server_default=sa.text('now()'), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('id', name='general_ledger_pkey')
    )
    op.create_index('ix_general_ledger_id', 'general_ledger', ['id'], unique=False)
    op.drop_table('appearance_theme_settings')
    # ### end Alembic commands ###
