<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220530092340 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 article (id INT AUTO_INCREMENT NOT NULL, libelle VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE bpu (id INT AUTO_INCREMENT NOT NULL, article_id INT DEFAULT NULL, etr_id INT DEFAULT NULL, article_etr VARCHAR(255) NOT NULL, pu DOUBLE PRECISION DEFAULT NULL, INDEX IDX_BB423A197294869C (article_id), INDEX IDX_BB423A19BD9F0D70 (etr_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE etr (id INT AUTO_INCREMENT NOT NULL, raison_sociale VARCHAR(255) DEFAULT NULL, voie VARCHAR(255) DEFAULT NULL, adresse VARCHAR(255) DEFAULT NULL, siret VARCHAR(255) DEFAULT NULL, prenom VARCHAR(255) DEFAULT NULL, nom VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, entreprise_fact VARCHAR(255) DEFAULT NULL, tva DOUBLE PRECISION DEFAULT NULL, contact VARCHAR(255) DEFAULT NULL, reduction DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE intervention_prod (id INT AUTO_INCREMENT NOT NULL, planning_etr_id INT DEFAULT NULL, jeton_rc INT DEFAULT NULL, code_du_departement_abonne VARCHAR(255) DEFAULT NULL, nom_du_departement_abonnee VARCHAR(255) DEFAULT NULL, code_de_la_commune_abonne VARCHAR(255) DEFAULT NULL, nom_de_la_commune_abonne VARCHAR(255) DEFAULT NULL, zone VARCHAR(255) DEFAULT NULL, technologie VARCHAR(255) DEFAULT NULL, nom_du_nro VARCHAR(255) DEFAULT NULL, operateur_immeuble VARCHAR(255) DEFAULT NULL, type_de_pbo VARCHAR(255) DEFAULT NULL, type_de_pto VARCHAR(255) DEFAULT NULL, intevention_id INT DEFAULT NULL, type_intervention VARCHAR(255) DEFAULT NULL, date_intervention DATE DEFAULT NULL, nom_du_prestataire VARCHAR(255) DEFAULT NULL, code_du_debriefing VARCHAR(255) DEFAULT NULL, nom_du_debriefing VARCHAR(255) DEFAULT NULL, reference_de_article VARCHAR(255) DEFAULT NULL, pu DOUBLE PRECISION DEFAULT NULL, qte INT DEFAULT NULL, montant DOUBLE PRECISION DEFAULT NULL, commentaire VARCHAR(255) DEFAULT NULL, INDEX IDX_BA0B0955DDBE2F1F (planning_etr_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE intervention_sav (id INT AUTO_INCREMENT NOT NULL, planning_etr_id INT DEFAULT NULL, intervention_id INT DEFAULT NULL, dbt INT DEFAULT NULL, nro VARCHAR(255) DEFAULT NULL, jeton VARCHAR(255) DEFAULT NULL, etat VARCHAR(255) DEFAULT NULL, rdv VARCHAR(255) DEFAULT NULL, type1 VARCHAR(255) DEFAULT NULL, date DATETIME DEFAULT NULL, boite_ident VARCHAR(255) DEFAULT NULL, entit_factu VARCHAR(255) DEFAULT NULL, article VARCHAR(255) DEFAULT NULL, qte INT DEFAULT NULL, pu DOUBLE PRECISION DEFAULT NULL, total DOUBLE PRECISION DEFAULT NULL, zone VARCHAR(255) DEFAULT NULL, type2 VARCHAR(255) DEFAULT NULL, INDEX IDX_D39777BDDDBE2F1F (planning_etr_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE mois_intervention (id INT AUTO_INCREMENT NOT NULL, mois INT NOT NULL, annee INT NOT NULL, description VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE planning_etr (id INT AUTO_INCREMENT NOT NULL, etr_id INT DEFAULT NULL, tech_id VARCHAR(255) DEFAULT NULL, login_technicien VARCHAR(255) DEFAULT NULL, INDEX IDX_455CB209BD9F0D70 (etr_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE bpu ADD CONSTRAINT FK_BB423A197294869C FOREIGN KEY (article_id) REFERENCES article (id)');
$this->addSql('ALTER TABLE bpu ADD CONSTRAINT FK_BB423A19BD9F0D70 FOREIGN KEY (etr_id) REFERENCES etr (id)');
$this->addSql('ALTER TABLE intervention_prod ADD CONSTRAINT FK_BA0B0955DDBE2F1F FOREIGN KEY (planning_etr_id) REFERENCES planning_etr (id)');
$this->addSql('ALTER TABLE intervention_sav ADD CONSTRAINT FK_D39777BDDDBE2F1F FOREIGN KEY (planning_etr_id) REFERENCES planning_etr (id)');
$this->addSql('ALTER TABLE planning_etr ADD CONSTRAINT FK_455CB209BD9F0D70 FOREIGN KEY (etr_id) REFERENCES etr (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bpu DROP FOREIGN KEY FK_BB423A197294869C');
$this->addSql('ALTER TABLE bpu DROP FOREIGN KEY FK_BB423A19BD9F0D70');
$this->addSql('ALTER TABLE planning_etr DROP FOREIGN KEY FK_455CB209BD9F0D70');
$this->addSql('ALTER TABLE intervention_prod DROP FOREIGN KEY FK_BA0B0955DDBE2F1F');
$this->addSql('ALTER TABLE intervention_sav DROP FOREIGN KEY FK_D39777BDDDBE2F1F');
$this->addSql('DROP TABLE article');
$this->addSql('DROP TABLE bpu');
$this->addSql('DROP TABLE etr');
$this->addSql('DROP TABLE intervention_prod');
$this->addSql('DROP TABLE intervention_sav');
$this->addSql('DROP TABLE mois_intervention');
$this->addSql('DROP TABLE planning_etr');
}
}