mirror of
https://gitea.tendokyu.moe/Hay1tsme/artemis.git
synced 2026-02-04 14:47:29 +08:00
Fixed bad default subtrophy values (issue #235)
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
"""chuni_subtrophy_db_fix
|
||||||
|
|
||||||
|
Revision ID: 318d52559e83
|
||||||
|
Revises: 8b57e9646449
|
||||||
|
Create Date: 2026-01-08 19:13:29.803912
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
from sqlalchemy.dialects import mysql
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '318d52559e83'
|
||||||
|
down_revision = '8b57e9646449'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
op.alter_column('chuni_profile_data', 'trophyIdSub1', existing_type=mysql.INTEGER(), server_default='-1')
|
||||||
|
op.alter_column('chuni_profile_data', 'trophyIdSub2', existing_type=mysql.INTEGER(), server_default='-1')
|
||||||
|
|
||||||
|
# fix any current profiles where the bad defaults were used
|
||||||
|
op.execute("UPDATE chuni_profile_data SET trophyIdSub1=-1 WHERE trophyIdSub1 IS NULL")
|
||||||
|
op.execute("UPDATE chuni_profile_data SET trophyIdSub2=-1 WHERE trophyIdSub2 IS NULL")
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# dont bother "unfixing" the table
|
||||||
|
pass
|
||||||
@@ -26,8 +26,8 @@ profile = Table(
|
|||||||
Column("frameId", Integer),
|
Column("frameId", Integer),
|
||||||
Column("isMaimai", Boolean),
|
Column("isMaimai", Boolean),
|
||||||
Column("trophyId", Integer),
|
Column("trophyId", Integer),
|
||||||
Column("trophyIdSub1", Integer),
|
Column("trophyIdSub1", Integer, server_default="-1"),
|
||||||
Column("trophyIdSub2", Integer),
|
Column("trophyIdSub2", Integer, server_default="-1"),
|
||||||
Column("userName", String(25)),
|
Column("userName", String(25)),
|
||||||
Column("isWebJoin", Boolean),
|
Column("isWebJoin", Boolean),
|
||||||
Column("playCount", Integer),
|
Column("playCount", Integer),
|
||||||
|
|||||||
Reference in New Issue
Block a user