forked from Hay1tsme/artemis
add mai2 database upgrade
This commit is contained in:
28
core/data/alembic/versions/28443e2da5b8_mai2_buddies_plus.py
Normal file
28
core/data/alembic/versions/28443e2da5b8_mai2_buddies_plus.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
"""mai2_buddies_plus
|
||||||
|
|
||||||
|
Revision ID: 28443e2da5b8
|
||||||
|
Revises: 5ea73f89d982
|
||||||
|
Create Date: 2024-09-15 20:44:02.351819
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '28443e2da5b8'
|
||||||
|
down_revision = '5ea73f89d982'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
op.add_column('mai2_profile_detail', sa.Column('point', sa.Integer()))
|
||||||
|
op.add_column('mai2_profile_detail', sa.Column('totalPoint', sa.Integer()))
|
||||||
|
op.add_column('mai2_profile_detail', sa.Column('friendRegistSkip', sa.SmallInteger()))
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
op.drop_column('mai2_profile_detail', 'point')
|
||||||
|
op.drop_column('mai2_profile_detail', 'totalPoint')
|
||||||
|
op.drop_column('mai2_profile_detail', 'friendRegistSkip')
|
@ -3,7 +3,7 @@ from titles.mai2.const import Mai2Constants
|
|||||||
|
|
||||||
from typing import Optional, Dict, List
|
from typing import Optional, Dict, List
|
||||||
from sqlalchemy import Table, Column, UniqueConstraint, PrimaryKeyConstraint, and_
|
from sqlalchemy import Table, Column, UniqueConstraint, PrimaryKeyConstraint, and_
|
||||||
from sqlalchemy.types import Integer, String, TIMESTAMP, Boolean, JSON, BigInteger
|
from sqlalchemy.types import Integer, String, TIMESTAMP, Boolean, JSON, BigInteger, SmallInteger
|
||||||
from sqlalchemy.schema import ForeignKey
|
from sqlalchemy.schema import ForeignKey
|
||||||
from sqlalchemy.sql import func, select
|
from sqlalchemy.sql import func, select
|
||||||
from sqlalchemy.engine import Row
|
from sqlalchemy.engine import Row
|
||||||
@ -43,6 +43,8 @@ detail = Table(
|
|||||||
Column("currentPlayCount", Integer), # new with buddies
|
Column("currentPlayCount", Integer), # new with buddies
|
||||||
Column("renameCredit", Integer), # new with buddies
|
Column("renameCredit", Integer), # new with buddies
|
||||||
Column("mapStock", Integer), # new with fes+
|
Column("mapStock", Integer), # new with fes+
|
||||||
|
Column("point", Integer), # new with buddies+
|
||||||
|
Column("totalPoint", Integer), # new with buddies+
|
||||||
Column("eventWatchedDate", String(25)),
|
Column("eventWatchedDate", String(25)),
|
||||||
Column("lastGameId", String(25)),
|
Column("lastGameId", String(25)),
|
||||||
Column("lastRomVersion", String(25)),
|
Column("lastRomVersion", String(25)),
|
||||||
@ -97,6 +99,7 @@ detail = Table(
|
|||||||
Column("playerOldRating", BigInteger),
|
Column("playerOldRating", BigInteger),
|
||||||
Column("playerNewRating", BigInteger),
|
Column("playerNewRating", BigInteger),
|
||||||
Column("dateTime", BigInteger),
|
Column("dateTime", BigInteger),
|
||||||
|
Column("friendRegistSkip", SmallInteger), # new with buddies+
|
||||||
Column("banState", Integer), # new with uni+
|
Column("banState", Integer), # new with uni+
|
||||||
UniqueConstraint("user", "version", name="mai2_profile_detail_uk"),
|
UniqueConstraint("user", "version", name="mai2_profile_detail_uk"),
|
||||||
mysql_charset="utf8mb4",
|
mysql_charset="utf8mb4",
|
||||||
|
Reference in New Issue
Block a user