make migrations for GameRoomsUsers join table

This commit is contained in:
Sorrel Bri 2019-10-09 10:06:06 -07:00
parent 078bbec462
commit e5e7bb2a3f

View file

@ -0,0 +1,34 @@
"""empty message
Revision ID: 02be4c8fbd69
Revises: 0e0f8ad1362d
Create Date: 2019-10-09 10:05:32.403967
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '02be4c8fbd69'
down_revision = '0e0f8ad1362d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('game_rooms_users',
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('game_rooms_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['game_rooms_id'], ['game_rooms.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('user_id', 'game_rooms_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('game_rooms_users')
# ### end Alembic commands ###