"""Initial schema

Revision ID: 0001_initial
Revises: 
Create Date: 2026-01-25 19:00:00.000000

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy import inspect
from config.database import Base

# Import all models to ensure they're registered with Base.metadata
from models import (
    User,
    Event,
    EventParticipation,
    Album,
    Media,
    MediaLike,
    Post,
    PostMention,
    PostLike,
    PostComment,
    Vlog,
    VlogLike,
    VlogComment,
    Notification,
    SystemSettings,
    Information,
    Ticket
)

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


def upgrade() -> None:
    # Create all tables using Base.metadata with the Alembic connection
    # This uses the connection from the Alembic context
    bind = op.get_bind()
    Base.metadata.create_all(bind=bind)


def downgrade() -> None:
    # Drop all tables
    bind = op.get_bind()
    Base.metadata.drop_all(bind=bind)

