"""Adding table to associate License Tiers with Partner Services

Revision ID: bb27b5e41854
Revises: 605395afc22f
Create Date: 2025-04-22 20:20:34.526308

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'bb27b5e41854'
down_revision = '605395afc22f'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('partner_service_license_tier',
    sa.Column('partner_service_id', sa.Integer(), nullable=False),
    sa.Column('license_tier_id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('created_by', sa.Integer(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('updated_by', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['created_by'], ['public.user.id'], ),
    sa.ForeignKeyConstraint(['license_tier_id'], ['public.license_tier.id'], ),
    sa.ForeignKeyConstraint(['partner_service_id'], ['public.partner_service.id'], ),
    sa.ForeignKeyConstraint(['updated_by'], ['public.user.id'], ),
    sa.PrimaryKeyConstraint('partner_service_id', 'license_tier_id'),
    schema='public'
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('partner_service_license_tier', schema='public')
    # ### end Alembic commands ###
