51 lines
1.4 KiB
Python
51 lines
1.4 KiB
Python
|
"""Change intervals to integers
|
||
|
|
||
|
Revision ID: d15570037f47
|
||
|
Revises: 7995474ef2cc
|
||
|
Create Date: 2024-12-09 20:16:18.385467
|
||
|
|
||
|
"""
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = 'd15570037f47'
|
||
|
down_revision = '7995474ef2cc'
|
||
|
branch_labels = None
|
||
|
depends_on = None
|
||
|
|
||
|
|
||
|
def upgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
with op.batch_alter_table('matches', schema=None) as batch_op:
|
||
|
batch_op.alter_column('duration',
|
||
|
existing_type=sa.DATETIME(),
|
||
|
type_=sa.Integer(),
|
||
|
existing_nullable=False)
|
||
|
|
||
|
with op.batch_alter_table('players_teams', schema=None) as batch_op:
|
||
|
batch_op.alter_column('playtime',
|
||
|
existing_type=sa.DATETIME(),
|
||
|
type_=sa.Integer(),
|
||
|
existing_nullable=False)
|
||
|
|
||
|
# ### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
with op.batch_alter_table('players_teams', schema=None) as batch_op:
|
||
|
batch_op.alter_column('playtime',
|
||
|
existing_type=sa.Integer(),
|
||
|
type_=sa.DATETIME(),
|
||
|
existing_nullable=False)
|
||
|
|
||
|
with op.batch_alter_table('matches', schema=None) as batch_op:
|
||
|
batch_op.alter_column('duration',
|
||
|
existing_type=sa.Integer(),
|
||
|
type_=sa.DATETIME(),
|
||
|
existing_nullable=False)
|
||
|
|
||
|
# ### end Alembic commands ###
|