added user registration and login

This commit is contained in:
2025-01-20 15:42:10 +02:00
parent a6d0bbbd2b
commit 850360f553
16 changed files with 500 additions and 17 deletions

View File

@@ -0,0 +1,34 @@
"""Initial migration
Revision ID: 0de18b4ddaa3
Revises:
Create Date: 2025-01-20 14:50:44.116314
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0de18b4ddaa3'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('player', schema=None) as batch_op:
batch_op.add_column(sa.Column('user_id', sa.Integer(), nullable=True))
batch_op.create_foreign_key('fk_user_id', 'user', ['user_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('player', schema=None) as batch_op:
batch_op.drop_constraint('fk_user_id', type_='foreignkey')
batch_op.drop_column('user_id')
# ### end Alembic commands ###