forked from Hay1tsme/artemis
chuni: make total columns BigInt, for #203
This commit is contained in:
@ -0,0 +1,92 @@
|
|||||||
|
"""chuni_fix_total_scores
|
||||||
|
|
||||||
|
Revision ID: 91c682918b67
|
||||||
|
Revises: 9c42e54a27fe
|
||||||
|
Create Date: 2025-03-29 11:19:46.063173
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
from sqlalchemy.dialects import mysql
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '91c682918b67'
|
||||||
|
down_revision = '9c42e54a27fe'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.alter_column('chuni_profile_data', 'totalMapNum',
|
||||||
|
existing_type=mysql.INTEGER(display_width=11),
|
||||||
|
type_=sa.BigInteger(),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalHiScore',
|
||||||
|
existing_type=mysql.INTEGER(display_width=11),
|
||||||
|
type_=sa.BigInteger(),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalBasicHighScore',
|
||||||
|
existing_type=mysql.INTEGER(display_width=11),
|
||||||
|
type_=sa.BigInteger(),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalExpertHighScore',
|
||||||
|
existing_type=mysql.INTEGER(display_width=11),
|
||||||
|
type_=sa.BigInteger(),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalMasterHighScore',
|
||||||
|
existing_type=mysql.INTEGER(display_width=11),
|
||||||
|
type_=sa.BigInteger(),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalRepertoireCount',
|
||||||
|
existing_type=mysql.INTEGER(display_width=11),
|
||||||
|
type_=sa.BigInteger(),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalAdvancedHighScore',
|
||||||
|
existing_type=mysql.INTEGER(display_width=11),
|
||||||
|
type_=sa.BigInteger(),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalUltimaHighScore',
|
||||||
|
existing_type=mysql.INTEGER(display_width=11),
|
||||||
|
type_=sa.BigInteger(),
|
||||||
|
existing_nullable=True,
|
||||||
|
existing_server_default=sa.text("'0'"))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.alter_column('chuni_profile_data', 'totalUltimaHighScore',
|
||||||
|
existing_type=sa.BigInteger(),
|
||||||
|
type_=mysql.INTEGER(display_width=11),
|
||||||
|
existing_nullable=True,
|
||||||
|
existing_server_default=sa.text("'0'"))
|
||||||
|
op.alter_column('chuni_profile_data', 'totalAdvancedHighScore',
|
||||||
|
existing_type=sa.BigInteger(),
|
||||||
|
type_=mysql.INTEGER(display_width=11),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalRepertoireCount',
|
||||||
|
existing_type=sa.BigInteger(),
|
||||||
|
type_=mysql.INTEGER(display_width=11),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalMasterHighScore',
|
||||||
|
existing_type=sa.BigInteger(),
|
||||||
|
type_=mysql.INTEGER(display_width=11),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalExpertHighScore',
|
||||||
|
existing_type=sa.BigInteger(),
|
||||||
|
type_=mysql.INTEGER(display_width=11),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalBasicHighScore',
|
||||||
|
existing_type=sa.BigInteger(),
|
||||||
|
type_=mysql.INTEGER(display_width=11),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalHiScore',
|
||||||
|
existing_type=sa.BigInteger(),
|
||||||
|
type_=mysql.INTEGER(display_width=11),
|
||||||
|
existing_nullable=True)
|
||||||
|
op.alter_column('chuni_profile_data', 'totalMapNum',
|
||||||
|
existing_type=sa.BigInteger(),
|
||||||
|
type_=mysql.INTEGER(display_width=11),
|
||||||
|
existing_nullable=True)
|
||||||
|
# ### end Alembic commands ###
|
@ -35,13 +35,13 @@ profile = Table(
|
|||||||
Column("friendCount", Integer),
|
Column("friendCount", Integer),
|
||||||
Column("lastPlaceId", Integer),
|
Column("lastPlaceId", Integer),
|
||||||
Column("nameplateId", Integer),
|
Column("nameplateId", Integer),
|
||||||
Column("totalMapNum", Integer),
|
Column("totalMapNum", BigInteger),
|
||||||
Column("lastAllNetId", Integer),
|
Column("lastAllNetId", Integer),
|
||||||
Column("lastClientId", String(25)),
|
Column("lastClientId", String(25)),
|
||||||
Column("lastPlayDate", String(25)),
|
Column("lastPlayDate", String(25)),
|
||||||
Column("lastRegionId", Integer),
|
Column("lastRegionId", Integer),
|
||||||
Column("playerRating", Integer),
|
Column("playerRating", Integer),
|
||||||
Column("totalHiScore", Integer),
|
Column("totalHiScore", BigInteger),
|
||||||
Column("webLimitDate", String(25)),
|
Column("webLimitDate", String(25)),
|
||||||
Column("firstPlayDate", String(25)),
|
Column("firstPlayDate", String(25)),
|
||||||
Column("highestRating", Integer),
|
Column("highestRating", Integer),
|
||||||
@ -59,12 +59,12 @@ profile = Table(
|
|||||||
Column("firstDataVersion", String(25)),
|
Column("firstDataVersion", String(25)),
|
||||||
Column("reincarnationNum", Integer),
|
Column("reincarnationNum", Integer),
|
||||||
Column("playedTutorialBit", Integer),
|
Column("playedTutorialBit", Integer),
|
||||||
Column("totalBasicHighScore", Integer),
|
Column("totalBasicHighScore", BigInteger),
|
||||||
Column("totalExpertHighScore", Integer),
|
Column("totalExpertHighScore", BigInteger),
|
||||||
Column("totalMasterHighScore", Integer),
|
Column("totalMasterHighScore", BigInteger),
|
||||||
Column("totalRepertoireCount", Integer),
|
Column("totalRepertoireCount", BigInteger),
|
||||||
Column("firstTutorialCancelNum", Integer),
|
Column("firstTutorialCancelNum", Integer),
|
||||||
Column("totalAdvancedHighScore", Integer),
|
Column("totalAdvancedHighScore", BigInteger),
|
||||||
Column("masterTutorialCancelNum", Integer),
|
Column("masterTutorialCancelNum", Integer),
|
||||||
Column("ext1", Integer), # Added in chunew
|
Column("ext1", Integer), # Added in chunew
|
||||||
Column("ext2", Integer),
|
Column("ext2", Integer),
|
||||||
@ -111,7 +111,7 @@ profile = Table(
|
|||||||
Column("classEmblemBase", Integer, server_default="0"),
|
Column("classEmblemBase", Integer, server_default="0"),
|
||||||
Column("battleRankPoint", Integer, server_default="0"),
|
Column("battleRankPoint", Integer, server_default="0"),
|
||||||
Column("netBattle2ndCount", Integer, server_default="0"),
|
Column("netBattle2ndCount", Integer, server_default="0"),
|
||||||
Column("totalUltimaHighScore", Integer, server_default="0"),
|
Column("totalUltimaHighScore", BigInteger, server_default="0"),
|
||||||
Column("skillId", Integer, server_default="0"),
|
Column("skillId", Integer, server_default="0"),
|
||||||
Column("lastCountryCode", String(5), server_default="JPN"),
|
Column("lastCountryCode", String(5), server_default="JPN"),
|
||||||
Column("isNetBattleHost", Boolean, server_default="0"),
|
Column("isNetBattleHost", Boolean, server_default="0"),
|
||||||
@ -808,6 +808,7 @@ class ChuniProfileData(BaseData):
|
|||||||
if result is None:
|
if result is None:
|
||||||
return None
|
return None
|
||||||
return result.fetchone()
|
return result.fetchone()
|
||||||
|
|
||||||
async def get_overview(self) -> Dict:
|
async def get_overview(self) -> Dict:
|
||||||
# Fetch and add up all the playcounts
|
# Fetch and add up all the playcounts
|
||||||
playcount_sql = await self.execute(select(profile.c.playCount))
|
playcount_sql = await self.execute(select(profile.c.playCount))
|
||||||
|
Reference in New Issue
Block a user