This repository has been archived on 2025-01-27. You can view files and clone it, but cannot push or open issues or pull requests.
wot_stats_server/migrations/versions/2017_08_27_03_02.py

47 lines
1.3 KiB
Python
Raw Normal View History

2017-09-03 18:46:19 +03:00
"""New table userwotdetails
2017-08-27 04:09:23 +03:00
Revision ID: b3222bf2cedb
Revises: 5766fed0b2ef
Create Date: 2017-08-27 03:02:09.126373
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b3222bf2cedb'
down_revision = 'f5e44761054e'
branch_labels = None
depends_on = None
def upgrade():
2017-09-03 18:46:19 +03:00
op.create_table(
'user_wot_details',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user', sa.Integer(), nullable=True),
sa.Column('nickname', sa.String(32), unique=True),
sa.Column('client_language', sa.String(length=3)),
sa.Column('last_battle_time', sa.Integer),
sa.Column('account_id', sa.Integer),
sa.Column('created_at', sa.Integer),
sa.Column('updated_at', sa.Integer),
sa.Column('logout_at', sa.Integer),
sa.Column('private', sa.String(32)),
sa.Column('global_rating', sa.String(32)),
sa.Column('clan_id', sa.Integer),
sa.PrimaryKeyConstraint('id'),
sa.ForeignKeyConstraint(['user'], ['user.id']),
sa.UniqueConstraint('nickname')
)
2017-08-28 10:22:38 +03:00
pass
2017-08-27 04:09:23 +03:00
def downgrade():
2017-09-03 18:46:19 +03:00
op.drop_table('user_wot_details')
2017-08-27 04:09:23 +03:00
pass
2017-09-03 18:46:19 +03:00
# op.add_column('user', sa.Column('token', sa.String(256), nullable=True, ))
# op.drop_column('user', 'token')