mirror of
https://github.com/Llloooggg/TextSouls.git
synced 2026-03-06 04:26:23 +03:00
backend: добавлена генерация базовых характеристик персонажа
This commit is contained in:
128
backend/migrations/versions/231e5697b63e_.py
Normal file
128
backend/migrations/versions/231e5697b63e_.py
Normal file
@@ -0,0 +1,128 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 231e5697b63e
|
||||
Revises: 57b47e18fdab
|
||||
Create Date: 2022-11-19 21:56:35.469495
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '231e5697b63e'
|
||||
down_revision = '57b47e18fdab'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('character_classes', schema=None) as batch_op:
|
||||
batch_op.alter_column('endurance_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('strength_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('agility_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('defence_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('wisdom_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
|
||||
with op.batch_alter_table('character_races', schema=None) as batch_op:
|
||||
batch_op.alter_column('endurance_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('strength_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('agility_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('defence_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('wisdom_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
|
||||
with op.batch_alter_table('characters', schema=None) as batch_op:
|
||||
batch_op.alter_column('endurance_base',
|
||||
existing_type=mysql.INTEGER(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('strength_base',
|
||||
existing_type=mysql.INTEGER(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('agility_base',
|
||||
existing_type=mysql.INTEGER(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('defence_base',
|
||||
existing_type=mysql.INTEGER(),
|
||||
nullable=False)
|
||||
batch_op.alter_column('wisdom_base',
|
||||
existing_type=mysql.INTEGER(),
|
||||
nullable=False)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('characters', schema=None) as batch_op:
|
||||
batch_op.alter_column('wisdom_base',
|
||||
existing_type=mysql.INTEGER(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('defence_base',
|
||||
existing_type=mysql.INTEGER(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('agility_base',
|
||||
existing_type=mysql.INTEGER(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('strength_base',
|
||||
existing_type=mysql.INTEGER(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('endurance_base',
|
||||
existing_type=mysql.INTEGER(),
|
||||
nullable=True)
|
||||
|
||||
with op.batch_alter_table('character_races', schema=None) as batch_op:
|
||||
batch_op.alter_column('wisdom_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('defence_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('agility_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('strength_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('endurance_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
|
||||
with op.batch_alter_table('character_classes', schema=None) as batch_op:
|
||||
batch_op.alter_column('wisdom_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('defence_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('agility_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('strength_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('endurance_koef',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user