backend: добавлена генерация базовых характеристик персонажа

This commit is contained in:
2022-11-19 22:01:09 +03:00
parent deee83dc80
commit 62b5f7b815
2 changed files with 181 additions and 29 deletions

View 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 ###