EditionPN/migrations/versions/15feabeae315_.py

102 lines
4.0 KiB
Python

"""empty message
Revision ID: 15feabeae315
Revises:
Create Date: 2021-05-07 16:45:01.928258
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '15feabeae315'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('AC',
sa.Column('code', sa.String(length=6), nullable=False),
sa.Column('titre', sa.String(length=255), nullable=True),
sa.PrimaryKeyConstraint('code')
)
op.create_table('PN',
sa.Column('code', sa.String(length=3), nullable=False),
sa.Column('nom', sa.String(length=255), nullable=True),
sa.Column('diminutif', sa.String(length=30), nullable=True),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('type', sa.String(length=1), nullable=True),
sa.PrimaryKeyConstraint('code')
)
op.create_table('SAE',
sa.Column('code', sa.String(length=5), nullable=False),
sa.Column('titre', sa.String(length=255), nullable=True),
sa.Column('semestre', sa.String(length=255), nullable=True),
sa.Column('heures_encadrees', sa.String(length=3), nullable=True),
sa.Column('heures_tp', sa.String(length=3), nullable=True),
sa.Column('projet', sa.String(length=3), nullable=True),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('coef', sa.String(length=255), nullable=True),
sa.Column('livrables', sa.Text(), nullable=True),
sa.Column('motscles', sa.String(length=255), nullable=True),
sa.PrimaryKeyConstraint('code')
)
op.create_table('competence',
sa.Column('code', sa.String(length=3), nullable=False),
sa.Column('nom', sa.String(length=255), nullable=True),
sa.Column('diminutif', sa.String(length=30), nullable=True),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('composantes', sa.Text(), nullable=True),
sa.Column('situations', sa.Text(), nullable=True),
sa.Column('niveaux', sa.Text(), nullable=True),
sa.PrimaryKeyConstraint('code')
)
op.create_table('ressource',
sa.Column('code', sa.String(length=4), nullable=False),
sa.Column('nom', sa.String(length=255), nullable=True),
sa.Column('semestre', sa.String(length=255), nullable=True),
sa.Column('heures_formation', sa.String(length=3), nullable=True),
sa.Column('heures_tp', sa.String(length=3), nullable=True),
sa.Column('coef', sa.String(length=255), nullable=True),
sa.Column('prerequis', sa.String(length=255), nullable=True),
sa.Column('contexte', sa.Text(), nullable=True),
sa.Column('contenu', sa.Text(), nullable=True),
sa.Column('motscles', sa.String(length=255), nullable=True),
sa.PrimaryKeyConstraint('code')
)
op.create_table('Ressources_ACs',
sa.Column('Ressource_code', sa.String(length=4), nullable=True),
sa.Column('AC_code', sa.String(length=6), nullable=True),
sa.ForeignKeyConstraint(['AC_code'], ['AC.code'], ),
sa.ForeignKeyConstraint(['Ressource_code'], ['ressource.code'], )
)
op.create_table('Ressources_SAEs',
sa.Column('Ressource_code', sa.String(length=4), nullable=True),
sa.Column('SAE_code', sa.String(length=5), nullable=True),
sa.ForeignKeyConstraint(['Ressource_code'], ['ressource.code'], ),
sa.ForeignKeyConstraint(['SAE_code'], ['SAE.code'], )
)
op.create_table('SAEs_ACs',
sa.Column('SAE_code', sa.String(length=5), nullable=True),
sa.Column('AC_code', sa.String(length=6), nullable=True),
sa.ForeignKeyConstraint(['AC_code'], ['AC.code'], ),
sa.ForeignKeyConstraint(['SAE_code'], ['SAE.code'], )
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('SAEs_ACs')
op.drop_table('Ressources_SAEs')
op.drop_table('Ressources_ACs')
op.drop_table('ressource')
op.drop_table('competence')
op.drop_table('SAE')
op.drop_table('PN')
op.drop_table('AC')
# ### end Alembic commands ###