"""empty message

Revision ID: 2ca8562d0583
Revises: ca72d84f7d8b
Create Date: 2023-11-18 14:48:47.609335

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('histo_user_infos',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.BigInteger(), nullable=False),
    sa.Column('name', sa.Text(), nullable=True),
    sa.Column('price', sa.Float(), server_default='0', nullable=False),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('promotion', sa.Boolean(), server_default='true', nullable=False),
    sa.Column('post_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('media_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('image_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('video_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('audio_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('stream_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('archived_post_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('private_archived_post_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('favourited_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('favourites_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('subscribers_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('size', sa.BigInteger(), server_default='0', nullable=False),
    sa.Column('location', sa.Text(), nullable=True),
    sa.Column('website', sa.Text(), nullable=True),
    sa.Column('created_at', sa.TIMESTAMP(timezone=True), server_default=sa.text('now()'), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['fansly.users.id'], ),
    sa.PrimaryKeyConstraint('id'),
    schema='fansly'
    )
    op.create_table('histo_user_infos',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.BigInteger(), nullable=False),
    sa.Column('name', sa.Text(), nullable=True),
    sa.Column('price', sa.Float(), server_default='0', nullable=False),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('promotion', sa.Boolean(), server_default='true', nullable=False),
    sa.Column('post_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('media_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('image_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('video_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('audio_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('stream_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('archived_post_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('private_archived_post_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('favourited_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('favourites_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('subscribers_count', sa.Integer(), server_default='0', nullable=False),
    sa.Column('size', sa.BigInteger(), server_default='0', nullable=False),
    sa.Column('location', sa.Text(), nullable=True),
    sa.Column('website', sa.Text(), nullable=True),
    sa.Column('created_at', sa.TIMESTAMP(timezone=True), server_default=sa.text('now()'), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['onlyfans.users.id'], ),
    sa.PrimaryKeyConstraint('id'),
    schema='onlyfans'
    )
    op.drop_index('user_infos_sex_idx', table_name='user_infos', schema='fansly')
    op.create_index(op.f('ix_fansly_user_infos_sex'), 'user_infos', ['sex'], unique=False, schema='fansly')
    op.drop_index('user_infos_sex_idx', table_name='user_infos', schema='onlyfans')
    op.create_index(op.f('ix_onlyfans_user_infos_sex'), 'user_infos', ['sex'], unique=False, schema='onlyfans')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_onlyfans_user_infos_sex'), table_name='user_infos', schema='onlyfans')
    op.create_index('user_infos_sex_idx', 'user_infos', ['sex'], unique=False, schema='onlyfans')
    op.drop_index(op.f('ix_fansly_user_infos_sex'), table_name='user_infos', schema='fansly')
    op.create_index('user_infos_sex_idx', 'user_infos', ['sex'], unique=False, schema='fansly')
    op.drop_table('histo_user_infos', schema='onlyfans')
    op.drop_table('histo_user_infos', schema='fansly')
    # ### end Alembic commands ###
