Skip to content
Snippets Groups Projects
Commit 4b00a5c8 authored by leonard_montalbano's avatar leonard_montalbano
Browse files

fix diffs avec origin master

parent c021572a
Branches
No related tags found
No related merge requests found
Showing
with 180 additions and 369 deletions
LICENSE 100755 → 100644
File mode changed from 100755 to 100644
README.md 100755 → 100644
File mode changed from 100755 to 100644
...@@ -451,7 +451,6 @@ class ApcAppCritique(db.Model, XMLModel): ...@@ -451,7 +451,6 @@ class ApcAppCritique(db.Model, XMLModel):
if competence is not None: if competence is not None:
query = query.filter(ApcNiveau.competence == competence) query = query.filter(ApcNiveau.competence == competence)
return query return query
<<<<<<< HEAD
def __init__(self, id, niveau_id, code, libelle, modules): def __init__(self, id, niveau_id, code, libelle, modules):
self.id = id self.id = id
...@@ -459,8 +458,6 @@ class ApcAppCritique(db.Model, XMLModel): ...@@ -459,8 +458,6 @@ class ApcAppCritique(db.Model, XMLModel):
self.code = code self.code = code
self.libelle = libelle self.libelle = libelle
self.modules = modules self.modules = modules
=======
>>>>>>> 7c340c798ad59c41653efc83bfd079f11fce1938
def to_dict(self) -> dict: def to_dict(self) -> dict:
return {"libelle": self.libelle} return {"libelle": self.libelle}
...@@ -547,14 +544,11 @@ class ApcAnneeParcours(db.Model, XMLModel): ...@@ -547,14 +544,11 @@ class ApcAnneeParcours(db.Model, XMLModel):
) )
ordre = db.Column(db.Integer) ordre = db.Column(db.Integer)
"numéro de l'année: 1, 2, 3" "numéro de l'année: 1, 2, 3"
<<<<<<< HEAD
def __init__(self, id, parcours_id, ordre): def __init__(self, id, parcours_id, ordre):
self.id = id self.id = id
self.parcours_id = parcours_id self.parcours_id = parcours_id
self.ordre = ordre self.ordre = ordre
=======
>>>>>>> 7c340c798ad59c41653efc83bfd079f11fce1938
def __repr__(self): def __repr__(self):
return f"<{self.__class__.__name__} {self.id} ordre={self.ordre!r} parcours={self.parcours.code!r}>" return f"<{self.__class__.__name__} {self.id} ordre={self.ordre!r} parcours={self.parcours.code!r}>"
......
...@@ -121,7 +121,8 @@ def _list_dept_logos(dept_id=None, prefix=scu.LOGO_FILE_PREFIX): ...@@ -121,7 +121,8 @@ def _list_dept_logos(dept_id=None, prefix=scu.LOGO_FILE_PREFIX):
:return: le résultat de la recherche ou None si aucune image trouvée :return: le résultat de la recherche ou None si aucune image trouvée
""" """
allowed_ext = "|".join(scu.LOGOS_IMAGES_ALLOWED_TYPES) allowed_ext = "|".join(scu.LOGOS_IMAGES_ALLOWED_TYPES)
filename_parser = re.compile(f"{prefix}([^.]*).({allowed_ext})") # parse filename 'logo_<logoname>.<ext> . be carefull: logoname may include '.'
filename_parser = re.compile(f"{prefix}(([^.]*.)+)({allowed_ext})")
logos = {} logos = {}
path_dir = Path(scu.SCODOC_LOGOS_DIR) path_dir = Path(scu.SCODOC_LOGOS_DIR)
if dept_id: if dept_id:
...@@ -135,7 +136,7 @@ def _list_dept_logos(dept_id=None, prefix=scu.LOGO_FILE_PREFIX): ...@@ -135,7 +136,7 @@ def _list_dept_logos(dept_id=None, prefix=scu.LOGO_FILE_PREFIX):
if os.access(path_dir.joinpath(entry).absolute(), os.R_OK): if os.access(path_dir.joinpath(entry).absolute(), os.R_OK):
result = filename_parser.match(entry.name) result = filename_parser.match(entry.name)
if result: if result:
logoname = result.group(1) logoname = result.group(1)[:-1] # retreive logoname from filename (less final dot)
logos[logoname] = Logo(logoname=logoname, dept_id=dept_id).select() logos[logoname] = Logo(logoname=logoname, dept_id=dept_id).select()
return logos if len(logos.keys()) > 0 else None return logos if len(logos.keys()) > 0 else None
...@@ -191,6 +192,9 @@ class Logo: ...@@ -191,6 +192,9 @@ class Logo:
) )
self.mm = "Not initialized: call the select or create function before access" self.mm = "Not initialized: call the select or create function before access"
def __repr__(self) -> str:
return f"Logo(logoname='{self.logoname}', filename='{self.filename}')"
def _set_format(self, fmt): def _set_format(self, fmt):
self.suffix = fmt self.suffix = fmt
self.filepath = self.basepath + "." + fmt self.filepath = self.basepath + "." + fmt
......
bench.py 100755 → 100644
File mode changed from 100755 to 100644
...@@ -14,17 +14,17 @@ config = context.config ...@@ -14,17 +14,17 @@ config = context.config
# Interpret the config file for Python logging. # Interpret the config file for Python logging.
# This line sets up loggers basically. # This line sets up loggers basically.
fileConfig(config.config_file_name) fileConfig(config.config_file_name)
logger = logging.getLogger("alembic.env") logger = logging.getLogger('alembic.env')
# add your model's MetaData object here # add your model's MetaData object here
# for 'autogenerate' support # for 'autogenerate' support
# from myapp import mymodel # from myapp import mymodel
# target_metadata = mymodel.Base.metadata # target_metadata = mymodel.Base.metadata
config.set_main_option( config.set_main_option(
"sqlalchemy.url", 'sqlalchemy.url',
str(current_app.extensions["migrate"].db.get_engine().url).replace("%", "%%"), str(current_app.extensions['migrate'].db.get_engine().url).replace(
) '%', '%%'))
target_metadata = current_app.extensions["migrate"].db.metadata target_metadata = current_app.extensions['migrate'].db.metadata
# other values from the config, defined by the needs of env.py, # other values from the config, defined by the needs of env.py,
# can be acquired: # can be acquired:
...@@ -45,7 +45,9 @@ def run_migrations_offline(): ...@@ -45,7 +45,9 @@ def run_migrations_offline():
""" """
url = config.get_main_option("sqlalchemy.url") url = config.get_main_option("sqlalchemy.url")
context.configure(url=url, target_metadata=target_metadata, literal_binds=True) context.configure(
url=url, target_metadata=target_metadata, literal_binds=True
)
with context.begin_transaction(): with context.begin_transaction():
context.run_migrations() context.run_migrations()
...@@ -63,20 +65,20 @@ def run_migrations_online(): ...@@ -63,20 +65,20 @@ def run_migrations_online():
# when there are no changes to the schema # when there are no changes to the schema
# reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html # reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html
def process_revision_directives(context, revision, directives): def process_revision_directives(context, revision, directives):
if getattr(config.cmd_opts, "autogenerate", False): if getattr(config.cmd_opts, 'autogenerate', False):
script = directives[0] script = directives[0]
if script.upgrade_ops.is_empty(): if script.upgrade_ops.is_empty():
directives[:] = [] directives[:] = []
logger.info("No changes in schema detected.") logger.info('No changes in schema detected.')
connectable = current_app.extensions["migrate"].db.get_engine() connectable = current_app.extensions['migrate'].db.get_engine()
with connectable.connect() as connection: with connectable.connect() as connection:
context.configure( context.configure(
connection=connection, connection=connection,
target_metadata=target_metadata, target_metadata=target_metadata,
process_revision_directives=process_revision_directives, process_revision_directives=process_revision_directives,
**current_app.extensions["migrate"].configure_args **current_app.extensions['migrate'].configure_args
) )
with context.begin_transaction(): with context.begin_transaction():
......
...@@ -10,23 +10,21 @@ import sqlalchemy as sa ...@@ -10,23 +10,21 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "017e32eb4773" revision = '017e32eb4773'
down_revision = "6b071b7947e5" down_revision = '6b071b7947e5'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.add_column("identite", sa.Column("scodoc7_id", sa.Text(), nullable=True)) op.add_column('identite', sa.Column('scodoc7_id', sa.Text(), nullable=True))
op.add_column( op.add_column('notes_formsemestre', sa.Column('scodoc7_id', sa.Text(), nullable=True))
"notes_formsemestre", sa.Column("scodoc7_id", sa.Text(), nullable=True)
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_column("notes_formsemestre", "scodoc7_id") op.drop_column('notes_formsemestre', 'scodoc7_id')
op.drop_column("identite", "scodoc7_id") op.drop_column('identite', 'scodoc7_id')
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,38 +10,21 @@ import sqlalchemy as sa ...@@ -10,38 +10,21 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "1efe07413835" revision = '1efe07413835'
down_revision = "75cf18659984" down_revision = '75cf18659984'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint( op.drop_constraint('absences_notifications_formsemestre_id_fkey', 'absences_notifications', type_='foreignkey')
"absences_notifications_formsemestre_id_fkey", op.create_foreign_key(None, 'absences_notifications', 'notes_formsemestre', ['formsemestre_id'], ['id'], ondelete='CASCADE')
"absences_notifications",
type_="foreignkey",
)
op.create_foreign_key(
None,
"absences_notifications",
"notes_formsemestre",
["formsemestre_id"],
["id"],
ondelete="CASCADE",
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "absences_notifications", type_="foreignkey") op.drop_constraint(None, 'absences_notifications', type_='foreignkey')
op.create_foreign_key( op.create_foreign_key('absences_notifications_formsemestre_id_fkey', 'absences_notifications', 'notes_formsemestre', ['formsemestre_id'], ['id'])
"absences_notifications_formsemestre_id_fkey",
"absences_notifications",
"notes_formsemestre",
["formsemestre_id"],
["id"],
)
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,57 +10,25 @@ import sqlalchemy as sa ...@@ -10,57 +10,25 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "39818df276aa" revision = '39818df276aa'
down_revision = "1efe07413835" down_revision = '1efe07413835'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint( op.drop_constraint('itemsuivi_tags_assoc_tag_id_fkey', 'itemsuivi_tags_assoc', type_='foreignkey')
"itemsuivi_tags_assoc_tag_id_fkey", "itemsuivi_tags_assoc", type_="foreignkey" op.drop_constraint('itemsuivi_tags_assoc_itemsuivi_id_fkey', 'itemsuivi_tags_assoc', type_='foreignkey')
) op.create_foreign_key(None, 'itemsuivi_tags_assoc', 'itemsuivi', ['itemsuivi_id'], ['id'], ondelete='CASCADE')
op.drop_constraint( op.create_foreign_key(None, 'itemsuivi_tags_assoc', 'itemsuivi_tags', ['tag_id'], ['id'], ondelete='CASCADE')
"itemsuivi_tags_assoc_itemsuivi_id_fkey",
"itemsuivi_tags_assoc",
type_="foreignkey",
)
op.create_foreign_key(
None,
"itemsuivi_tags_assoc",
"itemsuivi",
["itemsuivi_id"],
["id"],
ondelete="CASCADE",
)
op.create_foreign_key(
None,
"itemsuivi_tags_assoc",
"itemsuivi_tags",
["tag_id"],
["id"],
ondelete="CASCADE",
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "itemsuivi_tags_assoc", type_="foreignkey") op.drop_constraint(None, 'itemsuivi_tags_assoc', type_='foreignkey')
op.drop_constraint(None, "itemsuivi_tags_assoc", type_="foreignkey") op.drop_constraint(None, 'itemsuivi_tags_assoc', type_='foreignkey')
op.create_foreign_key( op.create_foreign_key('itemsuivi_tags_assoc_itemsuivi_id_fkey', 'itemsuivi_tags_assoc', 'itemsuivi', ['itemsuivi_id'], ['id'])
"itemsuivi_tags_assoc_itemsuivi_id_fkey", op.create_foreign_key('itemsuivi_tags_assoc_tag_id_fkey', 'itemsuivi_tags_assoc', 'itemsuivi_tags', ['tag_id'], ['id'])
"itemsuivi_tags_assoc",
"itemsuivi",
["itemsuivi_id"],
["id"],
)
op.create_foreign_key(
"itemsuivi_tags_assoc_tag_id_fkey",
"itemsuivi_tags_assoc",
"itemsuivi_tags",
["tag_id"],
["id"],
)
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,24 +10,19 @@ import sqlalchemy as sa ...@@ -10,24 +10,19 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "669065fb2d20" revision = '669065fb2d20'
down_revision = "a217bf588f4c" down_revision = 'a217bf588f4c'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.add_column( op.add_column('notes_formsemestre', sa.Column('block_moyennes', sa.Boolean(), server_default='false', nullable=False))
"notes_formsemestre",
sa.Column(
"block_moyennes", sa.Boolean(), server_default="false", nullable=False
),
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_column("notes_formsemestre", "block_moyennes") op.drop_column('notes_formsemestre', 'block_moyennes')
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,31 +10,25 @@ import sqlalchemy as sa ...@@ -10,31 +10,25 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "6b071b7947e5" revision = '6b071b7947e5'
down_revision = "993ce4a01d57" down_revision = '993ce4a01d57'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.alter_column( op.alter_column('notes_modules', 'code',
"notes_modules",
"code",
existing_type=sa.VARCHAR(length=32), existing_type=sa.VARCHAR(length=32),
type_=sa.Text(), type_=sa.Text(),
existing_nullable=False, existing_nullable=False)
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.alter_column( op.alter_column('notes_modules', 'code',
"notes_modules",
"code",
existing_type=sa.Text(), existing_type=sa.Text(),
type_=sa.VARCHAR(length=32), type_=sa.VARCHAR(length=32),
existing_nullable=False, existing_nullable=False)
)
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,33 +10,26 @@ import sqlalchemy as sa ...@@ -10,33 +10,26 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "6cfc21a7ae1b" revision = '6cfc21a7ae1b'
down_revision = "ada0d1f3d84f" down_revision = 'ada0d1f3d84f'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.create_table( op.create_table('module_ue_coef',
"module_ue_coef", sa.Column('module_id', sa.Integer(), nullable=False),
sa.Column("module_id", sa.Integer(), nullable=False), sa.Column('ue_id', sa.Integer(), nullable=False),
sa.Column("ue_id", sa.Integer(), nullable=False), sa.Column('coef', sa.Float(), nullable=False),
sa.Column("coef", sa.Float(), nullable=False), sa.ForeignKeyConstraint(['module_id'], ['notes_modules.id'], ),
sa.ForeignKeyConstraint( sa.ForeignKeyConstraint(['ue_id'], ['notes_ue.id'], ),
["module_id"], sa.PrimaryKeyConstraint('module_id', 'ue_id')
["notes_modules.id"],
),
sa.ForeignKeyConstraint(
["ue_id"],
["notes_ue.id"],
),
sa.PrimaryKeyConstraint("module_id", "ue_id"),
) )
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_table("module_ue_coef") op.drop_table('module_ue_coef')
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,50 +10,25 @@ import sqlalchemy as sa ...@@ -10,50 +10,25 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "75cf18659984" revision = '75cf18659984'
down_revision = "d74b4e16fb3c" down_revision = 'd74b4e16fb3c'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint( op.drop_constraint('notes_modules_tags_tag_id_fkey', 'notes_modules_tags', type_='foreignkey')
"notes_modules_tags_tag_id_fkey", "notes_modules_tags", type_="foreignkey" op.drop_constraint('notes_modules_tags_module_id_fkey', 'notes_modules_tags', type_='foreignkey')
) op.create_foreign_key(None, 'notes_modules_tags', 'notes_tags', ['tag_id'], ['id'], ondelete='CASCADE')
op.drop_constraint( op.create_foreign_key(None, 'notes_modules_tags', 'notes_modules', ['module_id'], ['id'], ondelete='CASCADE')
"notes_modules_tags_module_id_fkey", "notes_modules_tags", type_="foreignkey"
)
op.create_foreign_key(
None, "notes_modules_tags", "notes_tags", ["tag_id"], ["id"], ondelete="CASCADE"
)
op.create_foreign_key(
None,
"notes_modules_tags",
"notes_modules",
["module_id"],
["id"],
ondelete="CASCADE",
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "notes_modules_tags", type_="foreignkey") op.drop_constraint(None, 'notes_modules_tags', type_='foreignkey')
op.drop_constraint(None, "notes_modules_tags", type_="foreignkey") op.drop_constraint(None, 'notes_modules_tags', type_='foreignkey')
op.create_foreign_key( op.create_foreign_key('notes_modules_tags_module_id_fkey', 'notes_modules_tags', 'notes_modules', ['module_id'], ['id'])
"notes_modules_tags_module_id_fkey", op.create_foreign_key('notes_modules_tags_tag_id_fkey', 'notes_modules_tags', 'notes_tags', ['tag_id'], ['id'])
"notes_modules_tags",
"notes_modules",
["module_id"],
["id"],
)
op.create_foreign_key(
"notes_modules_tags_tag_id_fkey",
"notes_modules_tags",
"notes_tags",
["tag_id"],
["id"],
)
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,77 +10,46 @@ import sqlalchemy as sa ...@@ -10,77 +10,46 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "92789d50f6b6" revision = '92789d50f6b6'
down_revision = "00ad500fb118" down_revision = '00ad500fb118'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_table("modules_acs") op.drop_table('modules_acs')
op.drop_table("app_crit") op.drop_table('app_crit')
op.add_column("apc_annee_parcours", sa.Column("ordre", sa.Integer(), nullable=True)) op.add_column('apc_annee_parcours', sa.Column('ordre', sa.Integer(), nullable=True))
op.drop_column("apc_annee_parcours", "numero") op.drop_column('apc_annee_parcours', 'numero')
op.create_index( op.create_index(op.f('ix_apc_app_critique_code'), 'apc_app_critique', ['code'], unique=False)
op.f("ix_apc_app_critique_code"), "apc_app_critique", ["code"], unique=False op.create_unique_constraint('apc_competence_referentiel_id_titre_key', 'apc_competence', ['referentiel_id', 'titre'])
) op.create_index(op.f('ix_apc_competence_titre'), 'apc_competence', ['titre'], unique=False)
op.create_unique_constraint( op.add_column('apc_referentiel_competences', sa.Column('scodoc_date_loaded', sa.DateTime(), nullable=True))
"apc_competence_referentiel_id_titre_key", op.add_column('apc_referentiel_competences', sa.Column('scodoc_orig_filename', sa.Text(), nullable=True))
"apc_competence",
["referentiel_id", "titre"],
)
op.create_index(
op.f("ix_apc_competence_titre"), "apc_competence", ["titre"], unique=False
)
op.add_column(
"apc_referentiel_competences",
sa.Column("scodoc_date_loaded", sa.DateTime(), nullable=True),
)
op.add_column(
"apc_referentiel_competences",
sa.Column("scodoc_orig_filename", sa.Text(), nullable=True),
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_column("apc_referentiel_competences", "scodoc_orig_filename") op.drop_column('apc_referentiel_competences', 'scodoc_orig_filename')
op.drop_column("apc_referentiel_competences", "scodoc_date_loaded") op.drop_column('apc_referentiel_competences', 'scodoc_date_loaded')
op.drop_index(op.f("ix_apc_competence_titre"), table_name="apc_competence") op.drop_index(op.f('ix_apc_competence_titre'), table_name='apc_competence')
op.drop_constraint( op.drop_constraint('apc_competence_referentiel_id_titre_key', 'apc_competence', type_='unique')
"apc_competence_referentiel_id_titre_key", "apc_competence", type_="unique" op.drop_index(op.f('ix_apc_app_critique_code'), table_name='apc_app_critique')
) op.add_column('apc_annee_parcours', sa.Column('numero', sa.INTEGER(), autoincrement=False, nullable=True))
op.drop_index(op.f("ix_apc_app_critique_code"), table_name="apc_app_critique") op.drop_column('apc_annee_parcours', 'ordre')
op.add_column( op.create_table('app_crit',
"apc_annee_parcours", sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('app_crit_id_seq'::regclass)"), autoincrement=True, nullable=False),
sa.Column("numero", sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('code', sa.TEXT(), autoincrement=False, nullable=False),
) sa.Column('titre', sa.TEXT(), autoincrement=False, nullable=True),
op.drop_column("apc_annee_parcours", "ordre") sa.PrimaryKeyConstraint('id', name='app_crit_pkey'),
op.create_table( postgresql_ignore_search_path=False
"app_crit", )
sa.Column( op.create_table('modules_acs',
"id", sa.Column('module_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.INTEGER(), sa.Column('ac_id', sa.INTEGER(), autoincrement=False, nullable=True),
server_default=sa.text("nextval('app_crit_id_seq'::regclass)"), sa.ForeignKeyConstraint(['ac_id'], ['app_crit.id'], name='modules_acs_ac_id_fkey'),
autoincrement=True, sa.ForeignKeyConstraint(['module_id'], ['notes_modules.id'], name='modules_acs_module_id_fkey')
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"),
postgresql_ignore_search_path=False,
)
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"
),
) )
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,50 +10,27 @@ import sqlalchemy as sa ...@@ -10,50 +10,27 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "a217bf588f4c" revision = 'a217bf588f4c'
down_revision = "f73251d1d825" down_revision = 'f73251d1d825'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.alter_column( op.alter_column('notes_semset_formsemestre', 'semset_id',
"notes_semset_formsemestre",
"semset_id",
existing_type=sa.INTEGER(), existing_type=sa.INTEGER(),
nullable=False, nullable=False)
) op.drop_constraint('notes_semset_formsemestre_semset_id_fkey', 'notes_semset_formsemestre', type_='foreignkey')
op.drop_constraint( op.create_foreign_key(None, 'notes_semset_formsemestre', 'notes_semset', ['semset_id'], ['id'], ondelete='CASCADE')
"notes_semset_formsemestre_semset_id_fkey",
"notes_semset_formsemestre",
type_="foreignkey",
)
op.create_foreign_key(
None,
"notes_semset_formsemestre",
"notes_semset",
["semset_id"],
["id"],
ondelete="CASCADE",
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "notes_semset_formsemestre", type_="foreignkey") op.drop_constraint(None, 'notes_semset_formsemestre', type_='foreignkey')
op.create_foreign_key( op.create_foreign_key('notes_semset_formsemestre_semset_id_fkey', 'notes_semset_formsemestre', 'notes_semset', ['semset_id'], ['id'])
"notes_semset_formsemestre_semset_id_fkey", op.alter_column('notes_semset_formsemestre', 'semset_id',
"notes_semset_formsemestre",
"notes_semset",
["semset_id"],
["id"],
)
op.alter_column(
"notes_semset_formsemestre",
"semset_id",
existing_type=sa.INTEGER(), existing_type=sa.INTEGER(),
nullable=True, nullable=True)
)
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,23 +10,21 @@ import sqlalchemy as sa ...@@ -10,23 +10,21 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "c8efc54586d8" revision = 'c8efc54586d8'
down_revision = "6cfc21a7ae1b" down_revision = '6cfc21a7ae1b'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.add_column("notes_ue", sa.Column("semestre_idx", sa.Integer(), nullable=True)) op.add_column('notes_ue', sa.Column('semestre_idx', sa.Integer(), nullable=True))
op.create_index( op.create_index(op.f('ix_notes_ue_semestre_idx'), 'notes_ue', ['semestre_idx'], unique=False)
op.f("ix_notes_ue_semestre_idx"), "notes_ue", ["semestre_idx"], unique=False
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f("ix_notes_ue_semestre_idx"), table_name="notes_ue") op.drop_index(op.f('ix_notes_ue_semestre_idx'), table_name='notes_ue')
op.drop_column("notes_ue", "semestre_idx") op.drop_column('notes_ue', 'semestre_idx')
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,25 +10,23 @@ import sqlalchemy as sa ...@@ -10,25 +10,23 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "d3d92b2d0092" revision = 'd3d92b2d0092'
down_revision = "017e32eb4773" down_revision = '017e32eb4773'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.add_column("itemsuivi_tags", sa.Column("dept_id", sa.Integer(), nullable=True)) op.add_column('itemsuivi_tags', sa.Column('dept_id', sa.Integer(), nullable=True))
op.create_index( op.create_index(op.f('ix_itemsuivi_tags_dept_id'), 'itemsuivi_tags', ['dept_id'], unique=False)
op.f("ix_itemsuivi_tags_dept_id"), "itemsuivi_tags", ["dept_id"], unique=False op.create_foreign_key(None, 'itemsuivi_tags', 'departement', ['dept_id'], ['id'])
)
op.create_foreign_key(None, "itemsuivi_tags", "departement", ["dept_id"], ["id"])
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "itemsuivi_tags", type_="foreignkey") op.drop_constraint(None, 'itemsuivi_tags', type_='foreignkey')
op.drop_index(op.f("ix_itemsuivi_tags_dept_id"), table_name="itemsuivi_tags") op.drop_index(op.f('ix_itemsuivi_tags_dept_id'), table_name='itemsuivi_tags')
op.drop_column("itemsuivi_tags", "dept_id") op.drop_column('itemsuivi_tags', 'dept_id')
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,73 +10,49 @@ import sqlalchemy as sa ...@@ -10,73 +10,49 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "f6e7d2e01be1" revision = 'f6e7d2e01be1'
down_revision = "d3d92b2d0092" down_revision = 'd3d92b2d0092'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.alter_column( op.alter_column('notes_formsemestre_etapes', 'etape_apo',
"notes_formsemestre_etapes",
"etape_apo",
existing_type=sa.VARCHAR(length=16), existing_type=sa.VARCHAR(length=16),
type_=sa.String(length=24), type_=sa.String(length=24),
existing_nullable=True, existing_nullable=True)
) op.alter_column('notes_formsemestre_inscription', 'etape',
op.alter_column(
"notes_formsemestre_inscription",
"etape",
existing_type=sa.VARCHAR(length=16), existing_type=sa.VARCHAR(length=16),
type_=sa.String(length=24), type_=sa.String(length=24),
existing_nullable=True, existing_nullable=True)
) op.alter_column('notes_modules', 'code_apogee',
op.alter_column(
"notes_modules",
"code_apogee",
existing_type=sa.VARCHAR(length=16), existing_type=sa.VARCHAR(length=16),
type_=sa.String(length=24), type_=sa.String(length=24),
existing_nullable=True, existing_nullable=True)
) op.alter_column('notes_ue', 'code_apogee',
op.alter_column(
"notes_ue",
"code_apogee",
existing_type=sa.VARCHAR(length=16), existing_type=sa.VARCHAR(length=16),
type_=sa.String(length=24), type_=sa.String(length=24),
existing_nullable=True, existing_nullable=True)
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.alter_column( op.alter_column('notes_ue', 'code_apogee',
"notes_ue",
"code_apogee",
existing_type=sa.String(length=24), existing_type=sa.String(length=24),
type_=sa.VARCHAR(length=16), type_=sa.VARCHAR(length=16),
existing_nullable=True, existing_nullable=True)
) op.alter_column('notes_modules', 'code_apogee',
op.alter_column(
"notes_modules",
"code_apogee",
existing_type=sa.String(length=24), existing_type=sa.String(length=24),
type_=sa.VARCHAR(length=16), type_=sa.VARCHAR(length=16),
existing_nullable=True, existing_nullable=True)
) op.alter_column('notes_formsemestre_inscription', 'etape',
op.alter_column(
"notes_formsemestre_inscription",
"etape",
existing_type=sa.String(length=24), existing_type=sa.String(length=24),
type_=sa.VARCHAR(length=16), type_=sa.VARCHAR(length=16),
existing_nullable=True, existing_nullable=True)
) op.alter_column('notes_formsemestre_etapes', 'etape_apo',
op.alter_column(
"notes_formsemestre_etapes",
"etape_apo",
existing_type=sa.String(length=24), existing_type=sa.String(length=24),
type_=sa.VARCHAR(length=16), type_=sa.VARCHAR(length=16),
existing_nullable=True, existing_nullable=True)
)
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,29 +10,26 @@ import sqlalchemy as sa ...@@ -10,29 +10,26 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "f73251d1d825" revision = 'f73251d1d825'
down_revision = "f6e7d2e01be1" down_revision = 'f6e7d2e01be1'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.create_table( op.create_table('scodoc_site_config',
"scodoc_site_config", sa.Column('id', sa.Integer(), nullable=False),
sa.Column("id", sa.Integer(), nullable=False), sa.Column('name', sa.String(length=128), nullable=False),
sa.Column("name", sa.String(length=128), nullable=False), sa.Column('value', sa.Text(), nullable=True),
sa.Column("value", sa.Text(), nullable=True), sa.PrimaryKeyConstraint('id')
sa.PrimaryKeyConstraint("id"),
)
op.create_index(
op.f("ix_scodoc_site_config_name"), "scodoc_site_config", ["name"], unique=False
) )
op.create_index(op.f('ix_scodoc_site_config_name'), 'scodoc_site_config', ['name'], unique=False)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f("ix_scodoc_site_config_name"), table_name="scodoc_site_config") op.drop_index(op.f('ix_scodoc_site_config_name'), table_name='scodoc_site_config')
op.drop_table("scodoc_site_config") op.drop_table('scodoc_site_config')
# ### end Alembic commands ### # ### end Alembic commands ###
...@@ -10,31 +10,21 @@ import sqlalchemy as sa ...@@ -10,31 +10,21 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = "f86c013c9fbd" revision = 'f86c013c9fbd'
down_revision = "669065fb2d20" down_revision = '669065fb2d20'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint( op.drop_constraint('notes_formations_acronyme_titre_version_key', 'notes_formations', type_='unique')
"notes_formations_acronyme_titre_version_key", op.create_unique_constraint(None, 'notes_formations', ['dept_id', 'acronyme', 'titre', 'version'])
"notes_formations",
type_="unique",
)
op.create_unique_constraint(
None, "notes_formations", ["dept_id", "acronyme", "titre", "version"]
)
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "notes_formations", type_="unique") op.drop_constraint(None, 'notes_formations', type_='unique')
op.create_unique_constraint( op.create_unique_constraint('notes_formations_acronyme_titre_version_key', 'notes_formations', ['acronyme', 'titre', 'version'])
"notes_formations_acronyme_titre_version_key",
"notes_formations",
["acronyme", "titre", "version"],
)
# ### end Alembic commands ### # ### end Alembic commands ###
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment