Commit b1e145eb authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Finalisation scripts migration

parent 2df43e29
Loading
Loading
Loading
Loading
+1 −1
Changes for admin/migration/MigrationPrivilegesArchivage.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ use BddAdmin\Bdd;

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



+14 −5
Changes for admin/migration/MigrationStatutAutres.php: 14 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -19,9 +19,20 @@ class MigrationStatutAutres extends AbstractMigration

    public function utile(): bool
    {
        //Forcer le paramétrage du statuts AUTRES même après la migration v15
        return ($this->manager->hasNew('table', 'INTERVENANT_DOSSIER') ||
            $this->manager->has('table', 'INTERVENANT_DOSSIER'));
        if (!$this->manager->has('table', 'INTERVENANT_DOSSIER')) {
            return false;
        }

        $sql = "SELECT count(*) res FROM statut_intervenant WHERE code = 'AUTRES' AND (dossier_adresse = 1 OR
                    dossier_employeur = 1 OR
                    dossier_contact = 1 OR
                    dossier_iban = 1 OR
                    dossier_identite_comp = 1 OR
                    dossier_insee = 1)";

        $bdd = $this->manager->getBdd();

        return $bdd->select($sql)[0]['RES'] == '1';
    }


@@ -47,8 +58,6 @@ class MigrationStatutAutres extends AbstractMigration
    protected function after()
    {
        $bdd                   = $this->manager->getBdd();
        $console = $this->manager->getOseAdmin()->getConsole();
        $console->println("Traitement données perso statut AUTRES");
        $sqlUpdateStatutAutres = "
                UPDATE 
                    statut_intervenant 
+3 −20
Changes for admin/migration/NouveauxConnecteursV15.php: 3 added lines, 20 removed lines.
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@

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



@@ -25,17 +25,6 @@ class NouveauxConnecteursV15 extends AbstractMigration


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



    protected function before()
    {
        $bdd = $this->manager->getBdd();

@@ -46,16 +35,10 @@ class NouveauxConnecteursV15 extends AbstractMigration
        $bdd->getTable('IMPORT_TABLES')->update(['SYNC_ENABLED' => 0], ['TABLE_NAME' => 'DEPARTEMENT']);
        $bdd->getTable('IMPORT_TABLES')->update(['SYNC_ENABLED' => 0], ['TABLE_NAME' => 'PAYS']);

        $bdd->exec("UPDATE intervenant SET SOURCE_CODE = 'ID-' || id WHERE source_code IS NULL");

        // Reconstruction des vues diff et des proc maj pour éviter d'afficher des bugs après
        $this->manager->getOseAdmin()->exec('UnicaenImport MajVuesFonctions');
    }



    protected function after()
    {
        //$bdd = $this->manager->getBdd();
}
 No newline at end of file

}