"""empty message

Revision ID: 86985996f9b9
Revises: 2ca8562d0583
Create Date: 2023-11-26 19:05:09.231988

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '86985996f9b9'
down_revision = '2ca8562d0583'
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('content_media_asso', sa.Column('mass_message_id', sa.BigInteger(), nullable=True), schema='fansly')
    op.drop_constraint('content_media_asso_story_id_post_id_message_id_media_id_key', 'content_media_asso', schema='fansly', type_='unique')
    op.create_unique_constraint(None, 'content_media_asso', ['story_id', 'post_id', 'message_id', 'mass_message_id', 'media_id'], schema='fansly')
    op.create_foreign_key(None, 'content_media_asso', 'x_mass_messages', ['mass_message_id'], ['id'], source_schema='fansly', referent_schema='fansly')
    op.add_column('filepaths', sa.Column('mass_message_id', sa.BigInteger(), nullable=True), schema='fansly')
    op.create_foreign_key(None, 'filepaths', 'x_mass_messages', ['mass_message_id'], ['id'], source_schema='fansly', referent_schema='fansly')
    op.add_column('content_media_asso', sa.Column('mass_message_id', sa.BigInteger(), nullable=True), schema='onlyfans')
    op.drop_constraint('content_media_asso_story_id_post_id_message_id_media_id_key', 'content_media_asso', schema='onlyfans', type_='unique')
    op.create_unique_constraint(None, 'content_media_asso', ['story_id', 'post_id', 'message_id', 'mass_message_id', 'media_id'], schema='onlyfans')
    op.create_foreign_key(None, 'content_media_asso', 'x_mass_messages', ['mass_message_id'], ['id'], source_schema='onlyfans', referent_schema='onlyfans')
    op.add_column('filepaths', sa.Column('mass_message_id', sa.BigInteger(), nullable=True), schema='onlyfans')
    op.create_foreign_key(None, 'filepaths', 'x_mass_messages', ['mass_message_id'], ['id'], source_schema='onlyfans', referent_schema='onlyfans')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'filepaths', schema='onlyfans', type_='foreignkey')
    op.drop_column('filepaths', 'mass_message_id', schema='onlyfans')
    op.drop_constraint(None, 'content_media_asso', schema='onlyfans', type_='foreignkey')
    op.drop_constraint(None, 'content_media_asso', schema='onlyfans', type_='unique')
    op.create_unique_constraint('content_media_asso_story_id_post_id_message_id_media_id_key', 'content_media_asso', ['story_id', 'post_id', 'message_id', 'media_id'], schema='onlyfans')
    op.drop_column('content_media_asso', 'mass_message_id', schema='onlyfans')
    op.drop_constraint(None, 'filepaths', schema='fansly', type_='foreignkey')
    op.drop_column('filepaths', 'mass_message_id', schema='fansly')
    op.drop_constraint(None, 'content_media_asso', schema='fansly', type_='foreignkey')
    op.drop_constraint(None, 'content_media_asso', schema='fansly', type_='unique')
    op.create_unique_constraint('content_media_asso_story_id_post_id_message_id_media_id_key', 'content_media_asso', ['story_id', 'post_id', 'message_id', 'media_id'], schema='fansly')
    op.drop_column('content_media_asso', 'mass_message_id', schema='fansly')
    # ### end Alembic commands ###
