PCv5/migrations/versions/c961d7b7a7ea_ajout_des_titr...

48 lines
1.4 KiB
Python

"""Ajout des titres et trophées
Revision ID: c961d7b7a7ea
Revises: a6e89f3510d9
Create Date: 2019-06-06 15:18:09.893001
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c961d7b7a7ea'
down_revision = 'a6e89f3510d9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('trophy',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('type', sa.String(length=20), nullable=True),
sa.Column('name', sa.Text(_expect_unicode=True), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('title',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('title', sa.Text(_expect_unicode=True), nullable=True),
sa.ForeignKeyConstraint(['id'], ['trophy.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('trophy_member',
sa.Column('tid', sa.Integer(), nullable=True),
sa.Column('uid', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['tid'], ['trophy.id'], ),
sa.ForeignKeyConstraint(['uid'], ['member.id'], )
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('trophy_member')
op.drop_table('title')
op.drop_table('trophy')
# ### end Alembic commands ###