ScoDoc/migrations/versions/eed6d50fd9cb_refcomp.py

45 lines
1.5 KiB
Python

"""refcomp
Revision ID: eed6d50fd9cb
Revises: 00ad500fb118
Create Date: 2021-12-02 17:34:10.999132
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'eed6d50fd9cb'
down_revision = '00ad500fb118'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('app_crit')
op.drop_table('modules_acs')
op.add_column('apc_annee_parcours', sa.Column('ordre', sa.Integer(), nullable=True))
op.drop_column('apc_annee_parcours', 'numero')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('apc_annee_parcours', sa.Column('numero', sa.INTEGER(), autoincrement=False, nullable=True))
op.drop_column('apc_annee_parcours', 'ordre')
op.create_table('modules_acs',
sa.Column('module_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('ac_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['ac_id'], ['app_crit.id'], name='modules_acs_ac_id_fkey'),
sa.ForeignKeyConstraint(['module_id'], ['notes_modules.id'], name='modules_acs_module_id_fkey')
)
op.create_table('app_crit',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('code', sa.TEXT(), autoincrement=False, nullable=False),
sa.Column('titre', sa.TEXT(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint('id', name='app_crit_pkey')
)
# ### end Alembic commands ###