"""Mai2 Kaleidx Scope Support

Revision ID: 16f34bf7b968
Revises: d0f1c7fa9505
Create Date: 2025-04-02 07:06:15.829591

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '16f34bf7b968'
down_revision = 'd0f1c7fa9505'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('mai2_score_kaleidx_scope',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user', sa.Integer(), nullable=False),
    sa.Column('gateId', sa.Integer(), nullable=True),
    sa.Column('isGateFound', sa.Boolean(), nullable=True),
    sa.Column('isKeyFound', sa.Boolean(), nullable=True),
    sa.Column('isClear', sa.Boolean(), nullable=True),
    sa.Column('totalRestLife', sa.Integer(), nullable=True),
    sa.Column('totalAchievement', sa.Integer(), nullable=True),
    sa.Column('totalDeluxscore', sa.Integer(), nullable=True),
    sa.Column('bestAchievement', sa.Integer(), nullable=True),
    sa.Column('bestDeluxscore', sa.Integer(), nullable=True),
    sa.Column('bestAchievementDate', sa.String(length=25), nullable=True),
    sa.Column('bestDeluxscoreDate', sa.String(length=25), nullable=True),
    sa.Column('playCount', sa.Integer(), nullable=True),
    sa.Column('clearDate', sa.String(length=25), nullable=True),
    sa.Column('lastPlayDate', sa.String(length=25), nullable=True),
    sa.Column('isInfoWatched', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['user'], ['aime_user.id'], onupdate='cascade', ondelete='cascade'),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('user', 'gateId', name='mai2_score_best_uk'),
    mysql_charset='utf8mb4'
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('mai2_score_kaleidx_scope')
    # ### end Alembic commands ###
