migrations/Version20230821105015.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20230821105015 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE SEQUENCE adherent_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  19.         $this->addSql('CREATE SEQUENCE ca_concedant_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  20.         $this->addSql('CREATE SEQUENCE ca_fournisseur_df_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  21.         $this->addSql('CREATE SEQUENCE caconcedant_hors_referencer_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  22.         $this->addSql('CREATE SEQUENCE concedant_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  23.         $this->addSql('CREATE SEQUENCE concedant_hors_referencer_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  24.         $this->addSql('CREATE SEQUENCE data_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  25.         $this->addSql('CREATE SEQUENCE data_prospect_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  26.         $this->addSql('CREATE SEQUENCE departement_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  27.         $this->addSql('CREATE SEQUENCE famille_produit_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  28.         $this->addSql('CREATE SEQUENCE fournisseur_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  29.         $this->addSql('CREATE SEQUENCE marche_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  30.         $this->addSql('CREATE SEQUENCE marche_df_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  31.         $this->addSql('CREATE SEQUENCE marche_fournisseur_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  32.         $this->addSql('CREATE SEQUENCE marche_fr_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  33.         $this->addSql('CREATE SEQUENCE prospect_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  34.         $this->addSql('CREATE SEQUENCE secteur_animation_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  35.         $this->addSql('CREATE SEQUENCE taux_adherent_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  36.         $this->addSql('CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1');
  37.         $this->addSql('CREATE TABLE adherent (id INT NOT NULL, secteur_animation_id INT DEFAULT NULL, marche_primaire_id INT DEFAULT NULL, ref VARCHAR(50) NOT NULL, nom VARCHAR(255) NOT NULL, effectif VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
  38.         $this->addSql('CREATE INDEX IDX_90D3F06030FC657C ON adherent (secteur_animation_id)');
  39.         $this->addSql('CREATE INDEX IDX_90D3F060CD6AE4C8 ON adherent (marche_primaire_id)');
  40.         $this->addSql('CREATE TABLE ca_concedant (id INT NOT NULL, data_id INT DEFAULT NULL, marque_id INT DEFAULT NULL, data_prospect_id INT DEFAULT NULL, caconcedant DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id))');
  41.         $this->addSql('CREATE INDEX IDX_C40563E237F5A13C ON ca_concedant (data_id)');
  42.         $this->addSql('CREATE INDEX IDX_C40563E24827B9B2 ON ca_concedant (marque_id)');
  43.         $this->addSql('CREATE INDEX IDX_C40563E22E425940 ON ca_concedant (data_prospect_id)');
  44.         $this->addSql('CREATE TABLE ca_fournisseur_df (id INT NOT NULL, fournisseur_id INT DEFAULT NULL, data_prospect_id INT DEFAULT NULL, ca BIGINT DEFAULT NULL, n1 DOUBLE PRECISION DEFAULT NULL, n2 DOUBLE PRECISION DEFAULT NULL, n3 DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id))');
  45.         $this->addSql('CREATE INDEX IDX_49BFD557670C757F ON ca_fournisseur_df (fournisseur_id)');
  46.         $this->addSql('CREATE INDEX IDX_49BFD5572E425940 ON ca_fournisseur_df (data_prospect_id)');
  47.         $this->addSql('CREATE TABLE caconcedant_hors_referencer (id INT NOT NULL, concedant_hors_referencer_id INT DEFAULT NULL, data_id INT DEFAULT NULL, data_prospect_id INT DEFAULT NULL, ca DOUBLE PRECISION DEFAULT NULL, n1 DOUBLE PRECISION DEFAULT NULL, n2 DOUBLE PRECISION DEFAULT NULL, n3 DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id))');
  48.         $this->addSql('CREATE INDEX IDX_2D81A1F32FA2F3B ON caconcedant_hors_referencer (concedant_hors_referencer_id)');
  49.         $this->addSql('CREATE INDEX IDX_2D81A1F337F5A13C ON caconcedant_hors_referencer (data_id)');
  50.         $this->addSql('CREATE INDEX IDX_2D81A1F32E425940 ON caconcedant_hors_referencer (data_prospect_id)');
  51.         $this->addSql('CREATE TABLE concedant (id INT NOT NULL, nom VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
  52.         $this->addSql('CREATE TABLE concedant_adherent (concedant_id INT NOT NULL, adherent_id INT NOT NULL, PRIMARY KEY(concedant_id, adherent_id))');
  53.         $this->addSql('CREATE INDEX IDX_4568A28B32F06BD8 ON concedant_adherent (concedant_id)');
  54.         $this->addSql('CREATE INDEX IDX_4568A28B25F06C53 ON concedant_adherent (adherent_id)');
  55.         $this->addSql('CREATE TABLE concedant_hors_referencer (id INT NOT NULL, famille_id INT DEFAULT NULL, marches_df_id INT DEFAULT NULL, marque VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
  56.         $this->addSql('CREATE INDEX IDX_DFF85CB697A77B84 ON concedant_hors_referencer (famille_id)');
  57.         $this->addSql('CREATE INDEX IDX_DFF85CB6DDD51003 ON concedant_hors_referencer (marches_df_id)');
  58.         $this->addSql('CREATE TABLE concedant_hors_referencer_famille_produit (concedant_hors_referencer_id INT NOT NULL, famille_produit_id INT NOT NULL, PRIMARY KEY(concedant_hors_referencer_id, famille_produit_id))');
  59.         $this->addSql('CREATE INDEX IDX_79D908C22FA2F3B ON concedant_hors_referencer_famille_produit (concedant_hors_referencer_id)');
  60.         $this->addSql('CREATE INDEX IDX_79D908C2FBC0E351 ON concedant_hors_referencer_famille_produit (famille_produit_id)');
  61.         $this->addSql('CREATE TABLE data (id INT NOT NULL, adherent_id INT DEFAULT NULL, capropre_adherent DOUBLE PRECISION DEFAULT NULL, caconcedant DOUBLE PRECISION DEFAULT NULL, cahors_referencement DOUBLE PRECISION DEFAULT NULL, careferencement_delta_force DOUBLE PRECISION DEFAULT NULL, careferencement_materiel DOUBLE PRECISION DEFAULT NULL, careferencement_piece DOUBLE PRECISION DEFAULT NULL, careferencement_autre DOUBLE PRECISION DEFAULT NULL, data_ref VARCHAR(255) NOT NULL, annee INT NOT NULL, autre_ca_fournisseurs_hors_referencement TEXT DEFAULT NULL, ca_commande_groupes DOUBLE PRECISION DEFAULT NULL, ca_operation_natio_juin DOUBLE PRECISION DEFAULT NULL, ca_operation_natio_decembre DOUBLE PRECISION DEFAULT NULL, ca_operation_natio_total DOUBLE PRECISION DEFAULT NULL, ca_operations_commerciales DOUBLE PRECISION DEFAULT NULL, ca_achat_global DOUBLE PRECISION DEFAULT NULL, ca_achat_hors_tracto DOUBLE PRECISION DEFAULT NULL, somme_achat_store_expert DOUBLE PRECISION DEFAULT NULL, nb_tracteurs_neufs INT DEFAULT NULL, nb_tracteurs_occasions INT DEFAULT NULL, PRIMARY KEY(id))');
  62.         $this->addSql('CREATE INDEX IDX_ADF3F36325F06C53 ON data (adherent_id)');
  63.         $this->addSql('CREATE TABLE data_prospect (id INT NOT NULL, prospect_id INT DEFAULT NULL, annee VARCHAR(4) NOT NULL, tracto1 VARCHAR(255) DEFAULT NULL, tracto2 VARCHAR(255) DEFAULT NULL, chiffre_daffaire BIGINT DEFAULT NULL, total_ca_hr BIGINT DEFAULT NULL, total_ca_ref_materiel BIGINT DEFAULT NULL, total_ca_ref_magasin BIGINT DEFAULT NULL, total_ca_ref_autre BIGINT DEFAULT NULL, nb_tracteurs_neufs INT DEFAULT NULL, nb_tracteurs_occasions INT DEFAULT NULL, total_ca_concedant BIGINT DEFAULT NULL, total_ca_fournisseurs_df BIGINT DEFAULT NULL, ca_materiel_concedant DOUBLE PRECISION DEFAULT NULL, ca_materiel_hors_concedant DOUBLE PRECISION DEFAULT NULL, ca_magasin_concedant DOUBLE PRECISION DEFAULT NULL, ca_magasin_horsoncedant DOUBLE PRECISION DEFAULT NULL, ca_atelier DOUBLE PRECISION DEFAULT NULL, ca_occasion DOUBLE PRECISION DEFAULT NULL, part_du_marche DOUBLE PRECISION DEFAULT NULL, catalogue_printemps INT DEFAULT NULL, catalogue_automne INT DEFAULT NULL, op_nat INT DEFAULT NULL, panneaux_logos INT DEFAULT NULL, drapeau_classique INT DEFAULT NULL, drapeau_flamme INT DEFAULT NULL, drapeau_wind_flag_promo INT DEFAULT NULL, banne_promotion INT DEFAULT NULL, rouleau_habillage INT DEFAULT NULL, stop_rayon INT DEFAULT NULL, PRIMARY KEY(id))');
  64.         $this->addSql('CREATE INDEX IDX_31045A1D182060A ON data_prospect (prospect_id)');
  65.         $this->addSql('CREATE TABLE departement (id INT NOT NULL, code VARCHAR(10) DEFAULT NULL, nom VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
  66.         $this->addSql('CREATE TABLE famille_produit (id INT NOT NULL, nom VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
  67.         $this->addSql('CREATE TABLE fournisseur (id INT NOT NULL, marche_fournisseur_id INT DEFAULT NULL, marche_fr_id INT DEFAULT NULL, ref VARCHAR(10) NOT NULL, nom VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
  68.         $this->addSql('CREATE INDEX IDX_369ECA327BE33949 ON fournisseur (marche_fournisseur_id)');
  69.         $this->addSql('CREATE INDEX IDX_369ECA32A23C9E03 ON fournisseur (marche_fr_id)');
  70.         $this->addSql('CREATE TABLE marche (id INT NOT NULL, nom VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
  71.         $this->addSql('CREATE TABLE marche_df (id INT NOT NULL, nom VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
  72.         $this->addSql('CREATE TABLE marche_fournisseur (id INT NOT NULL, ref INT NOT NULL, nom VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
  73.         $this->addSql('CREATE TABLE marche_fr (id INT NOT NULL, ref INT DEFAULT NULL, marche VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
  74.         $this->addSql('CREATE TABLE prospect (id INT NOT NULL, animateur_id INT DEFAULT NULL, nom VARCHAR(255) NOT NULL, effectif VARCHAR(255) NOT NULL, contact_principal VARCHAR(255) DEFAULT NULL, email_contact VARCHAR(255) DEFAULT NULL, tel_contact VARCHAR(255) DEFAULT NULL, siret BIGINT DEFAULT NULL, dirigeant VARCHAR(255) DEFAULT NULL, debut_exercice DATE DEFAULT NULL, fin_exercice DATE DEFAULT NULL, nb_point_vente INT DEFAULT NULL, nb_lisa INT DEFAULT NULL, suface_lisa INT DEFAULT NULL, potentiel_tracteur INT DEFAULT NULL, PRIMARY KEY(id))');
  75.         $this->addSql('CREATE INDEX IDX_C9CE8C7D7F05C301 ON prospect (animateur_id)');
  76.         $this->addSql('CREATE TABLE prospect_marche (prospect_id INT NOT NULL, marche_id INT NOT NULL, PRIMARY KEY(prospect_id, marche_id))');
  77.         $this->addSql('CREATE INDEX IDX_FA3FFF31D182060A ON prospect_marche (prospect_id)');
  78.         $this->addSql('CREATE INDEX IDX_FA3FFF319E494911 ON prospect_marche (marche_id)');
  79.         $this->addSql('CREATE TABLE prospect_departement (prospect_id INT NOT NULL, departement_id INT NOT NULL, PRIMARY KEY(prospect_id, departement_id))');
  80.         $this->addSql('CREATE INDEX IDX_2AC745DED182060A ON prospect_departement (prospect_id)');
  81.         $this->addSql('CREATE INDEX IDX_2AC745DECCF9E01E ON prospect_departement (departement_id)');
  82.         $this->addSql('CREATE TABLE secteur_animation (id INT NOT NULL, ref INT NOT NULL, zone VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
  83.         $this->addSql('CREATE TABLE taux_adherent (id INT NOT NULL, adherent_id INT DEFAULT NULL, data_id INT DEFAULT NULL, annee INT DEFAULT NULL, taux_moyen_ca_adherent DOUBLE PRECISION DEFAULT NULL, taux_ref_materiel DOUBLE PRECISION DEFAULT NULL, taux_ref_piece DOUBLE PRECISION DEFAULT NULL, taux_ref_autre DOUBLE PRECISION DEFAULT NULL, taux_hors_referencement DOUBLE PRECISION DEFAULT NULL, taux_ca_commandes_groupes DOUBLE PRECISION DEFAULT NULL, taux_ca_operations_nationals DOUBLE PRECISION DEFAULT NULL, taux_op_commerciale DOUBLE PRECISION DEFAULT NULL, taux_moyen_hors_tracto DOUBLE PRECISION DEFAULT NULL, taux_ref_materiel_hors_tracto DOUBLE PRECISION DEFAULT NULL, taux_ref_piece_hors_tracto DOUBLE PRECISION DEFAULT NULL, taux_ref_autre_hors_tracto DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id))');
  84.         $this->addSql('CREATE INDEX IDX_F43FEA8425F06C53 ON taux_adherent (adherent_id)');
  85.         $this->addSql('CREATE UNIQUE INDEX UNIQ_F43FEA8437F5A13C ON taux_adherent (data_id)');
  86.         $this->addSql('CREATE TABLE "user" (id INT NOT NULL, secteur_animation_id INT DEFAULT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
  87.         $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E7927C74 ON "user" (email)');
  88.         $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D64930FC657C ON "user" (secteur_animation_id)');
  89.         $this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
  90.         $this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)');
  91.         $this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)');
  92.         $this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)');
  93.         $this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$
  94.             BEGIN
  95.                 PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text);
  96.                 RETURN NEW;
  97.             END;
  98.         $$ LANGUAGE plpgsql;');
  99.         $this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;');
  100.         $this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();');
  101.         $this->addSql('ALTER TABLE adherent ADD CONSTRAINT FK_90D3F06030FC657C FOREIGN KEY (secteur_animation_id) REFERENCES secteur_animation (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  102.         $this->addSql('ALTER TABLE adherent ADD CONSTRAINT FK_90D3F060CD6AE4C8 FOREIGN KEY (marche_primaire_id) REFERENCES marche (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  103.         $this->addSql('ALTER TABLE ca_concedant ADD CONSTRAINT FK_C40563E237F5A13C FOREIGN KEY (data_id) REFERENCES data (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  104.         $this->addSql('ALTER TABLE ca_concedant ADD CONSTRAINT FK_C40563E24827B9B2 FOREIGN KEY (marque_id) REFERENCES concedant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  105.         $this->addSql('ALTER TABLE ca_concedant ADD CONSTRAINT FK_C40563E22E425940 FOREIGN KEY (data_prospect_id) REFERENCES data_prospect (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  106.         $this->addSql('ALTER TABLE ca_fournisseur_df ADD CONSTRAINT FK_49BFD557670C757F FOREIGN KEY (fournisseur_id) REFERENCES fournisseur (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  107.         $this->addSql('ALTER TABLE ca_fournisseur_df ADD CONSTRAINT FK_49BFD5572E425940 FOREIGN KEY (data_prospect_id) REFERENCES data_prospect (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  108.         $this->addSql('ALTER TABLE caconcedant_hors_referencer ADD CONSTRAINT FK_2D81A1F32FA2F3B FOREIGN KEY (concedant_hors_referencer_id) REFERENCES concedant_hors_referencer (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  109.         $this->addSql('ALTER TABLE caconcedant_hors_referencer ADD CONSTRAINT FK_2D81A1F337F5A13C FOREIGN KEY (data_id) REFERENCES data (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  110.         $this->addSql('ALTER TABLE caconcedant_hors_referencer ADD CONSTRAINT FK_2D81A1F32E425940 FOREIGN KEY (data_prospect_id) REFERENCES data_prospect (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  111.         $this->addSql('ALTER TABLE concedant_adherent ADD CONSTRAINT FK_4568A28B32F06BD8 FOREIGN KEY (concedant_id) REFERENCES concedant (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
  112.         $this->addSql('ALTER TABLE concedant_adherent ADD CONSTRAINT FK_4568A28B25F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
  113.         $this->addSql('ALTER TABLE concedant_hors_referencer ADD CONSTRAINT FK_DFF85CB697A77B84 FOREIGN KEY (famille_id) REFERENCES marche_fournisseur (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  114.         $this->addSql('ALTER TABLE concedant_hors_referencer ADD CONSTRAINT FK_DFF85CB6DDD51003 FOREIGN KEY (marches_df_id) REFERENCES marche_df (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  115.         $this->addSql('ALTER TABLE concedant_hors_referencer_famille_produit ADD CONSTRAINT FK_79D908C22FA2F3B FOREIGN KEY (concedant_hors_referencer_id) REFERENCES concedant_hors_referencer (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
  116.         $this->addSql('ALTER TABLE concedant_hors_referencer_famille_produit ADD CONSTRAINT FK_79D908C2FBC0E351 FOREIGN KEY (famille_produit_id) REFERENCES famille_produit (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
  117.         $this->addSql('ALTER TABLE data ADD CONSTRAINT FK_ADF3F36325F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  118.         $this->addSql('ALTER TABLE data_prospect ADD CONSTRAINT FK_31045A1D182060A FOREIGN KEY (prospect_id) REFERENCES prospect (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  119.         $this->addSql('ALTER TABLE fournisseur ADD CONSTRAINT FK_369ECA327BE33949 FOREIGN KEY (marche_fournisseur_id) REFERENCES marche_fournisseur (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  120.         $this->addSql('ALTER TABLE fournisseur ADD CONSTRAINT FK_369ECA32A23C9E03 FOREIGN KEY (marche_fr_id) REFERENCES marche_fournisseur (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  121.         $this->addSql('ALTER TABLE prospect ADD CONSTRAINT FK_C9CE8C7D7F05C301 FOREIGN KEY (animateur_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  122.         $this->addSql('ALTER TABLE prospect_marche ADD CONSTRAINT FK_FA3FFF31D182060A FOREIGN KEY (prospect_id) REFERENCES prospect (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
  123.         $this->addSql('ALTER TABLE prospect_marche ADD CONSTRAINT FK_FA3FFF319E494911 FOREIGN KEY (marche_id) REFERENCES marche (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
  124.         $this->addSql('ALTER TABLE prospect_departement ADD CONSTRAINT FK_2AC745DED182060A FOREIGN KEY (prospect_id) REFERENCES prospect (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
  125.         $this->addSql('ALTER TABLE prospect_departement ADD CONSTRAINT FK_2AC745DECCF9E01E FOREIGN KEY (departement_id) REFERENCES departement (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
  126.         $this->addSql('ALTER TABLE taux_adherent ADD CONSTRAINT FK_F43FEA8425F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  127.         $this->addSql('ALTER TABLE taux_adherent ADD CONSTRAINT FK_F43FEA8437F5A13C FOREIGN KEY (data_id) REFERENCES data (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  128.         $this->addSql('ALTER TABLE "user" ADD CONSTRAINT FK_8D93D64930FC657C FOREIGN KEY (secteur_animation_id) REFERENCES secteur_animation (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  129.     }
  130.     public function down(Schema $schema): void
  131.     {
  132.         // this down() migration is auto-generated, please modify it to your needs
  133.         $this->addSql('CREATE SCHEMA public');
  134.         $this->addSql('ALTER TABLE concedant_adherent DROP CONSTRAINT FK_4568A28B25F06C53');
  135.         $this->addSql('ALTER TABLE data DROP CONSTRAINT FK_ADF3F36325F06C53');
  136.         $this->addSql('ALTER TABLE taux_adherent DROP CONSTRAINT FK_F43FEA8425F06C53');
  137.         $this->addSql('ALTER TABLE ca_concedant DROP CONSTRAINT FK_C40563E24827B9B2');
  138.         $this->addSql('ALTER TABLE concedant_adherent DROP CONSTRAINT FK_4568A28B32F06BD8');
  139.         $this->addSql('ALTER TABLE caconcedant_hors_referencer DROP CONSTRAINT FK_2D81A1F32FA2F3B');
  140.         $this->addSql('ALTER TABLE concedant_hors_referencer_famille_produit DROP CONSTRAINT FK_79D908C22FA2F3B');
  141.         $this->addSql('ALTER TABLE ca_concedant DROP CONSTRAINT FK_C40563E237F5A13C');
  142.         $this->addSql('ALTER TABLE caconcedant_hors_referencer DROP CONSTRAINT FK_2D81A1F337F5A13C');
  143.         $this->addSql('ALTER TABLE taux_adherent DROP CONSTRAINT FK_F43FEA8437F5A13C');
  144.         $this->addSql('ALTER TABLE ca_concedant DROP CONSTRAINT FK_C40563E22E425940');
  145.         $this->addSql('ALTER TABLE ca_fournisseur_df DROP CONSTRAINT FK_49BFD5572E425940');
  146.         $this->addSql('ALTER TABLE caconcedant_hors_referencer DROP CONSTRAINT FK_2D81A1F32E425940');
  147.         $this->addSql('ALTER TABLE prospect_departement DROP CONSTRAINT FK_2AC745DECCF9E01E');
  148.         $this->addSql('ALTER TABLE concedant_hors_referencer_famille_produit DROP CONSTRAINT FK_79D908C2FBC0E351');
  149.         $this->addSql('ALTER TABLE ca_fournisseur_df DROP CONSTRAINT FK_49BFD557670C757F');
  150.         $this->addSql('ALTER TABLE adherent DROP CONSTRAINT FK_90D3F060CD6AE4C8');
  151.         $this->addSql('ALTER TABLE prospect_marche DROP CONSTRAINT FK_FA3FFF319E494911');
  152.         $this->addSql('ALTER TABLE concedant_hors_referencer DROP CONSTRAINT FK_DFF85CB6DDD51003');
  153.         $this->addSql('ALTER TABLE concedant_hors_referencer DROP CONSTRAINT FK_DFF85CB697A77B84');
  154.         $this->addSql('ALTER TABLE fournisseur DROP CONSTRAINT FK_369ECA327BE33949');
  155.         $this->addSql('ALTER TABLE fournisseur DROP CONSTRAINT FK_369ECA32A23C9E03');
  156.         $this->addSql('ALTER TABLE data_prospect DROP CONSTRAINT FK_31045A1D182060A');
  157.         $this->addSql('ALTER TABLE prospect_marche DROP CONSTRAINT FK_FA3FFF31D182060A');
  158.         $this->addSql('ALTER TABLE prospect_departement DROP CONSTRAINT FK_2AC745DED182060A');
  159.         $this->addSql('ALTER TABLE adherent DROP CONSTRAINT FK_90D3F06030FC657C');
  160.         $this->addSql('ALTER TABLE "user" DROP CONSTRAINT FK_8D93D64930FC657C');
  161.         $this->addSql('ALTER TABLE prospect DROP CONSTRAINT FK_C9CE8C7D7F05C301');
  162.         $this->addSql('DROP SEQUENCE adherent_id_seq CASCADE');
  163.         $this->addSql('DROP SEQUENCE ca_concedant_id_seq CASCADE');
  164.         $this->addSql('DROP SEQUENCE ca_fournisseur_df_id_seq CASCADE');
  165.         $this->addSql('DROP SEQUENCE caconcedant_hors_referencer_id_seq CASCADE');
  166.         $this->addSql('DROP SEQUENCE concedant_id_seq CASCADE');
  167.         $this->addSql('DROP SEQUENCE concedant_hors_referencer_id_seq CASCADE');
  168.         $this->addSql('DROP SEQUENCE data_id_seq CASCADE');
  169.         $this->addSql('DROP SEQUENCE data_prospect_id_seq CASCADE');
  170.         $this->addSql('DROP SEQUENCE departement_id_seq CASCADE');
  171.         $this->addSql('DROP SEQUENCE famille_produit_id_seq CASCADE');
  172.         $this->addSql('DROP SEQUENCE fournisseur_id_seq CASCADE');
  173.         $this->addSql('DROP SEQUENCE marche_id_seq CASCADE');
  174.         $this->addSql('DROP SEQUENCE marche_df_id_seq CASCADE');
  175.         $this->addSql('DROP SEQUENCE marche_fournisseur_id_seq CASCADE');
  176.         $this->addSql('DROP SEQUENCE marche_fr_id_seq CASCADE');
  177.         $this->addSql('DROP SEQUENCE prospect_id_seq CASCADE');
  178.         $this->addSql('DROP SEQUENCE secteur_animation_id_seq CASCADE');
  179.         $this->addSql('DROP SEQUENCE taux_adherent_id_seq CASCADE');
  180.         $this->addSql('DROP SEQUENCE "user_id_seq" CASCADE');
  181.         $this->addSql('DROP TABLE adherent');
  182.         $this->addSql('DROP TABLE ca_concedant');
  183.         $this->addSql('DROP TABLE ca_fournisseur_df');
  184.         $this->addSql('DROP TABLE caconcedant_hors_referencer');
  185.         $this->addSql('DROP TABLE concedant');
  186.         $this->addSql('DROP TABLE concedant_adherent');
  187.         $this->addSql('DROP TABLE concedant_hors_referencer');
  188.         $this->addSql('DROP TABLE concedant_hors_referencer_famille_produit');
  189.         $this->addSql('DROP TABLE data');
  190.         $this->addSql('DROP TABLE data_prospect');
  191.         $this->addSql('DROP TABLE departement');
  192.         $this->addSql('DROP TABLE famille_produit');
  193.         $this->addSql('DROP TABLE fournisseur');
  194.         $this->addSql('DROP TABLE marche');
  195.         $this->addSql('DROP TABLE marche_df');
  196.         $this->addSql('DROP TABLE marche_fournisseur');
  197.         $this->addSql('DROP TABLE marche_fr');
  198.         $this->addSql('DROP TABLE prospect');
  199.         $this->addSql('DROP TABLE prospect_marche');
  200.         $this->addSql('DROP TABLE prospect_departement');
  201.         $this->addSql('DROP TABLE secteur_animation');
  202.         $this->addSql('DROP TABLE taux_adherent');
  203.         $this->addSql('DROP TABLE "user"');
  204.         $this->addSql('DROP TABLE messenger_messages');
  205.     }
  206. }