1
0
mirror of synced 2024-12-21 10:25:54 +01:00
bemaniutils/bemani/data/migrations/versions/23a589a1785c_create_lobby_table.py
2019-12-08 21:43:49 +00:00

41 lines
1.2 KiB
Python

"""Create lobby table.
Revision ID: 23a589a1785c
Revises: 56dd21b994fe
Create Date: 2017-12-04 22:19:12.612743
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '23a589a1785c'
down_revision = '56dd21b994fe'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('lobby',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('game', sa.String(length=32), nullable=False),
sa.Column('version', sa.Integer(), nullable=False),
sa.Column('userid', sa.Integer(), nullable=False),
sa.Column('time', sa.Integer(), nullable=False),
sa.Column('data', sa.JSON(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('game', 'version', 'userid', name='game_version_userid'),
mysql_charset='utf8mb4'
)
op.create_index(op.f('ix_lobby_time'), 'lobby', ['time'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_lobby_time'), table_name='lobby')
op.drop_table('lobby')
# ### end Alembic commands ###