EditionPN/migrations/versions/7e3f15e7d9d0_.py

137 lines
5.6 KiB
Python
Raw Permalink Normal View History

2021-05-06 18:16:57 +02:00
"""empty message
2021-06-09 10:21:19 +02:00
Revision ID: 7e3f15e7d9d0
Revises:
2021-06-09 10:21:19 +02:00
Create Date: 2021-06-03 18:25:50.167616
2021-05-06 18:16:57 +02:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
2021-06-09 10:21:19 +02:00
revision = '7e3f15e7d9d0'
down_revision = None
2021-05-06 18:16:57 +02:00
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),
2021-05-06 18:16:57 +02:00
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('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('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')
)
2021-06-09 10:21:19 +02:00
op.create_table('semestre',
sa.Column('num', sa.String(length=1), nullable=False),
sa.PrimaryKeyConstraint('num')
)
op.create_table('ACs_Competences',
sa.Column('AC_code', sa.String(length=6), nullable=True),
sa.Column('Competence_code', sa.String(length=3), nullable=True),
sa.ForeignKeyConstraint(['AC_code'], ['AC.code'], ),
sa.ForeignKeyConstraint(['Competence_code'], ['competence.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'], )
)
2021-06-09 10:21:19 +02:00
op.create_table('Semestres_Competences',
sa.Column('Semestre_num', sa.String(length=1), nullable=True),
sa.Column('Competence_code', sa.String(length=3), nullable=True),
sa.ForeignKeyConstraint(['Competence_code'], ['competence.code'], ),
sa.ForeignKeyConstraint(['Semestre_num'], ['semestre.num'], )
)
op.create_table('coefSAE',
sa.Column('competence_code', sa.String(length=3), nullable=False),
sa.Column('sae_code', sa.String(length=6), nullable=False),
sa.Column('coef', sa.String(length=2), nullable=True),
sa.ForeignKeyConstraint(['competence_code'], ['competence.code'], ),
sa.ForeignKeyConstraint(['sae_code'], ['SAE.code'], ),
sa.PrimaryKeyConstraint('competence_code', 'sae_code')
)
op.create_table('coef_ressource',
sa.Column('competence_code', sa.String(length=3), nullable=False),
sa.Column('ressource_code', sa.String(length=4), nullable=False),
sa.Column('coef', sa.String(length=2), nullable=True),
sa.ForeignKeyConstraint(['competence_code'], ['competence.code'], ),
sa.ForeignKeyConstraint(['ressource_code'], ['ressource.code'], ),
sa.PrimaryKeyConstraint('competence_code', 'ressource_code')
)
2021-05-06 18:16:57 +02:00
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
2021-06-09 10:21:19 +02:00
op.drop_table('coef_ressource')
op.drop_table('coefSAE')
op.drop_table('Semestres_Competences')
op.drop_table('SAEs_ACs')
op.drop_table('Ressources_SAEs')
op.drop_table('Ressources_ACs')
2021-06-09 10:21:19 +02:00
op.drop_table('ACs_Competences')
op.drop_table('semestre')
2021-05-06 18:16:57 +02:00
op.drop_table('ressource')
op.drop_table('competence')
op.drop_table('SAE')
op.drop_table('PN')
2021-05-06 18:16:57 +02:00
op.drop_table('AC')
# ### end Alembic commands ###