"""add_shooting_system Revision ID: 7bf40aa6c4b5 Revises: 3b977a379456 Create Date: 2026-03-31 12:41:00.407691 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa revision: str = '7bf40aa6c4b5' down_revision: Union[str, None] = '3b977a379456' branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None def upgrade() -> None: op.create_table('shooting_requests', sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), sa.Column('creator_id', sa.Integer(), nullable=False), sa.Column('title', sa.String(length=200), nullable=False), sa.Column('city', sa.String(length=100), nullable=False), sa.Column('description', sa.Text(), nullable=True), sa.Column('style', sa.String(length=100), nullable=True), sa.Column('shoot_date', sa.DateTime(timezone=True), nullable=True), sa.Column('is_free', sa.Boolean(), nullable=False), sa.Column('budget_min', sa.Numeric(precision=10, scale=2), nullable=True), sa.Column('budget_max', sa.Numeric(precision=10, scale=2), nullable=True), sa.Column('role_needed', sa.String(length=20), nullable=False), sa.Column('max_applicants', sa.Integer(), nullable=False), sa.Column('contact_info', sa.String(length=200), nullable=True), sa.Column('spot_id', sa.Integer(), nullable=True), sa.Column('status', sa.String(length=20), nullable=False), sa.Column('audit_status', sa.String(length=20), nullable=False), sa.Column('reject_reason', sa.String(length=500), nullable=True), sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False), sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False), sa.ForeignKeyConstraint(['creator_id'], ['users.id'], ), sa.ForeignKeyConstraint(['spot_id'], ['spots.id'], ), sa.PrimaryKeyConstraint('id') ) op.create_index(op.f('ix_shooting_requests_city'), 'shooting_requests', ['city'], unique=False) op.create_index(op.f('ix_shooting_requests_creator_id'), 'shooting_requests', ['creator_id'], unique=False) op.create_index(op.f('ix_shooting_requests_status'), 'shooting_requests', ['status'], unique=False) op.create_table('shooting_applications', sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), sa.Column('request_id', sa.Integer(), nullable=False), sa.Column('applicant_id', sa.Integer(), nullable=False), sa.Column('message', sa.Text(), nullable=True), sa.Column('status', sa.String(length=20), nullable=False), sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False), sa.ForeignKeyConstraint(['applicant_id'], ['users.id'], ), sa.ForeignKeyConstraint(['request_id'], ['shooting_requests.id'], ), sa.PrimaryKeyConstraint('id') ) op.create_index(op.f('ix_shooting_applications_applicant_id'), 'shooting_applications', ['applicant_id'], unique=False) op.create_index(op.f('ix_shooting_applications_request_id'), 'shooting_applications', ['request_id'], unique=False) def downgrade() -> None: op.drop_index(op.f('ix_shooting_applications_request_id'), table_name='shooting_applications') op.drop_index(op.f('ix_shooting_applications_applicant_id'), table_name='shooting_applications') op.drop_table('shooting_applications') op.drop_index(op.f('ix_shooting_requests_status'), table_name='shooting_requests') op.drop_index(op.f('ix_shooting_requests_creator_id'), table_name='shooting_requests') op.drop_index(op.f('ix_shooting_requests_city'), table_name='shooting_requests') op.drop_table('shooting_requests')