Commit 73224d24 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Corrections pour éviter des erreurs lors de la mise à jour

parent b0eafd7d
Loading
Loading
Loading
Loading
+1 −3
Changes for admin/actions/test-migration.php: 1 added line, 3 removed lines.
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@

use BddAdmin\Ddl\Ddl;

$bdd     = $oa->getBdd();
$prepost = $c->getArg()[2];
$action  = $c->getArg()[3];

@@ -19,6 +18,5 @@ foreach ($ref as $ddlClass => $objects) {
    }
}

$mm = new MigrationManager($oa, $bdd);
$mm->initTablesDef($ref, $filters);
$mm = new MigrationManager($oa, $ref, $filters);
$mm->migration($prepost, $action);
 No newline at end of file
+1 −2
Changes for admin/actions/update-bdd.php: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -41,8 +41,7 @@ foreach ($tablesDep as $tableDep) {


// Initialisation et lancement de la pré-migration
$mm = new MigrationManager($oa, $bdd);
$mm->initTablesDef($ref, $filters);
$mm = new MigrationManager($oa, $ref, $filters);
$mm->migration('pre');


+74
Changes for admin/migration/IndexesContraintesDoublons.php: 74 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php





class IndexesContraintesDoublons extends AbstractMigration
{
    protected $contexte = self::CONTEXTE_ALL;



    public function description(): string
    {
        return "Préparation des indexes et des contraintes avant la migration vers la V15";
    }



    public function utile(): bool
    {
        return $this->manager->hasOld('index', 'CORPS_SRC_UN')
            && $this->manager->hasOld('index', 'TBL_AGR_INTERVENANT_FK_IDX');
    }



    public function action(string $contexte)
    {
        if ($contexte == self::CONTEXTE_PRE) {
            $this->before();
        } else {
            $this->after();
        }
    }



    protected function before()
    {
        $bdd = $this->manager->getBdd();
        $bdd->uniqueConstraint()->drop('DISCIPLINE_SOURCE_UN');
        $bdd->uniqueConstraint()->drop('AFFECTATION_RECHERCH_SOURCE_UN');
        $bdd->uniqueConstraint()->drop('CHEMIN_PEDAGOGIQUE_SOURCE_UN');
        $bdd->uniqueConstraint()->drop('EFFECTIFS_SOURCE_UN');
        $bdd->uniqueConstraint()->drop('GROUPE_TYPE_FORMATIO_SOURCE_UN');
        $bdd->uniqueConstraint()->drop('TYPE_FORMATION_SOURCE_UN');
        $bdd->uniqueConstraint()->drop('TYPE_MODULATEUR_EP_SOURCE_UN');
        $bdd->uniqueConstraint()->drop('TBL_VALIDATION_ENSEIGNEMENT_UN');
        $bdd->uniqueConstraint()->drop('AFFECTATION_SOURCE_UN');

        $bdd->refConstraint()->drop('DOSSIER_HCFK');
        $bdd->refConstraint()->drop('DOSSIER_HDFK');
        $bdd->refConstraint()->drop('DOSSIER_HMFK');
        $bdd->refConstraint()->drop('DOSSIER_INTERVENANT_FK');

        $bdd->index()->drop('CORPS_SOURCE_UN');
        $bdd->index()->drop('DISCIPLINE_SOURCE_UN');
        $bdd->index()->drop('TBL_NOEUD_ANNEE_IDX');
        $bdd->index()->drop('TBL_NOEUD_ETAPE_IDX');
        $bdd->index()->drop('TBL_NOEUD_GTF_IDX');
        $bdd->index()->drop('TBL_NOEUD_NETAPE_IDX');
        $bdd->index()->drop('TBL_NOEUD_NOEUD_IDX');
        $bdd->index()->drop('TBL_NOEUD_STRUCTURE_IDX');
    }



    protected function after()
    {

    }
}
+1 −1
Changes for admin/migration/MigrationDossier.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ class MigrationDossier extends AbstractMigration
    public function utile(): bool
    {
        $bdd = $this->manager->getBdd();
        if ($this->manager->hasOldTable('INTERVENANT_DOSSIER')) {
        if ($this->manager->hasOld('table', 'INTERVENANT_DOSSIER')) {
            $tableIntervenantDossier = $bdd->getTable('INTERVENANT_DOSSIER');
            //Si table intervenant_dossier n'est pas vide, c'est que la migration
            //a déjà eu lieu donc on ne lance pas la migration
+1 −1
Changes for admin/src/BddAdmin/Bdd.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ class Bdd
        Ddl::INDEX . '.drop'                => 'Suppression des indexes',
        Ddl::SEQUENCE . '.create'           => 'Création des séquences',
        Ddl::TABLE . '.create'              => 'Création des tables',
        Ddl::TABLE . '.alter'               => 'Modification des tables',
        Ddl::VIEW . '.create'               => 'Création des vues',
        Ddl::PACKAGE . '.create'            => 'Création des packages',
        Ddl::SEQUENCE . '.alter'            => 'Modification des séquences',
@@ -91,7 +92,6 @@ class Bdd
        Ddl::UNIQUE_CONSTRAINT . '.alter'   => 'Modification des contraintes d\'unicité',
        Ddl::TRIGGER . '.alter'             => 'Modification des triggers',
        Ddl::INDEX . '.alter'               => 'Modification des indexes',
        Ddl::TABLE . '.alter'               => 'Modification des tables',
        Ddl::INDEX . '.create'              => 'Création des indexes',
        Ddl::PRIMARY_CONSTRAINT . '.create' => 'Création des clés primaires',
        Ddl::REF_CONSTRAINT . '.create'     => 'Création des clés étrangères',
Loading