<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
* ( by php bin/console doctrine:migrations:diff )
*/
final class Version20230929210638 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE referentiel_prestation (id INT AUTO_INCREMENT NOT NULL, base_unite_operationnelle INT NOT NULL, type_unite_operationnelle VARCHAR(50) DEFAULT NULL, code VARCHAR(190) NOT NULL, enable TINYINT(1) DEFAULT \'1\', libelle VARCHAR(255) NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_E66B605977153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql("INSERT INTO referentiel.transcode_field_type (libelle, code, enable) VALUES('code_prestation', 'CODE_PRESTATION', 1);");
//--- EXEMPLES INSERTION CONFIG PRESTATIONS (SANS PASSER PAR LES FIXTURES CAR UN PEU RISQUE)
/*
-- OBJETS PRESTATIONS
INSERT INTO referentiel_prestation
(id, base_unite_operationnelle, type_unite_operationnelle, code, enable, libelle, created_at, updated_at)
VALUES(1, 15, 'MIN', 'PR_MTS15', 1, 'Montage 15 minute', '2023-10-06 16:04:55.000', '2023-10-06 16:04:55.000');
INSERT INTO referentiel_prestation
(id, base_unite_operationnelle, type_unite_operationnelle, code, enable, libelle, created_at, updated_at)
VALUES(2, 1, 'BOOLEEN', 'PR_DEEE', 1, 'Reprise déchets d''équipements électriques et électroniques', '2023-10-06 16:04:55.000', '2023-10-06 16:04:55.000');
INSERT INTO referentiel_prestation
(id, base_unite_operationnelle, type_unite_operationnelle, code, enable, libelle, created_at, updated_at)
VALUES(3, 1, 'BOOLEEN', 'PR_DEA', 1, 'Reprise déchets d''éléments d''ameublement', '2023-10-06 16:04:55.000', '2023-10-06 16:04:55.000');
INSERT INTO referentiel_prestation
(id, base_unite_operationnelle, type_unite_operationnelle, code, enable, libelle, created_at, updated_at)
VALUES(4, 1, 'BOOLEEN', 'PR_FIXMUR', 1, 'Fixation murale', '2023-10-06 16:04:55.000', '2023-10-06 16:04:55.000');
-- AIGUILLAGES DES PRESTATIONS
INSERT INTO transcode_flux
(field, referentiel, tradiss, wexlog, traplus, harmony, created_at, updated_at, aiguillage, aiguillage_id, enable, comptabilite, commentaire, edi, externe)
VALUES('code_prestation', 'PR_DEEE', NULL, NULL, NULL, NULL, '2023-10-06 16:04:55.000', '2023-10-06 16:04:55.000', '$familleProduit !== "GEM"', 'c30a7988deadabcceb770f7c2a54d0df', 1, NULL, NULL, '-B----', 'LV220');
INSERT INTO transcode_flux
(field, referentiel, tradiss, wexlog, traplus, harmony, created_at, updated_at, aiguillage, aiguillage_id, enable, comptabilite, commentaire, edi, externe)
VALUES('code_prestation', 'PR_DEA', NULL, NULL, NULL, NULL, '2023-10-06 16:04:55.000', '2023-10-06 16:04:55.000', '$familleProduit == "GEM"', '72e4ddbc616a9cfb0326939c35054802', 1, NULL, NULL, '-B----', 'LV230');
INSERT INTO transcode_flux
(field, referentiel, tradiss, wexlog, traplus, harmony, created_at, updated_at, aiguillage, aiguillage_id, enable, comptabilite, commentaire, edi, externe)
VALUES('code_prestation', 'PR_FIXMUR', NULL, NULL, NULL, NULL, '2023-10-06 16:04:55.000', '2023-10-06 16:04:55.000', '$do == "SAMSUNG"', 'e7f6e1d9d94244dc7b71c9f6e7d845a0', 1, NULL, NULL, '--C---', 'LV220');
*/
//---
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE referentiel_prestation');
}
}