backend + telegram: добавлено создание персонажа

This commit is contained in:
2022-11-19 01:31:35 +03:00
parent 2bc6931525
commit 194b5aaff1
11 changed files with 291 additions and 51 deletions

View File

@@ -0,0 +1,44 @@
"""empty message
Revision ID: 02142c549a8c
Revises: 07950b032eb7
Create Date: 2022-11-19 00:29:12.011840
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '02142c549a8c'
down_revision = '07950b032eb7'
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.create_unique_constraint(None, ['name'])
with op.batch_alter_table('character_races', schema=None) as batch_op:
batch_op.create_unique_constraint(None, ['name'])
with op.batch_alter_table('characters', schema=None) as batch_op:
batch_op.create_unique_constraint(None, ['name'])
# ### 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.drop_constraint(None, type_='unique')
with op.batch_alter_table('character_races', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
with op.batch_alter_table('character_classes', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
# ### end Alembic commands ###

View File

@@ -0,0 +1,36 @@
"""empty message
Revision ID: 07950b032eb7
Revises: 5aef83a8a42f
Create Date: 2022-11-18 23:40:33.130706
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '07950b032eb7'
down_revision = '5aef83a8a42f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('characters', schema=None) as batch_op:
batch_op.alter_column('owner',
existing_type=mysql.INTEGER(),
nullable=True)
# ### 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('owner',
existing_type=mysql.INTEGER(),
nullable=False)
# ### end Alembic commands ###