<?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 Version20251022070155 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
/*
$this->addSql('ALTER TABLE zone_quartier_zone DROP FOREIGN KEY FK_6E7AEB067F3454C0');
$this->addSql('DROP TABLE photo_old');
$this->addSql('DROP TABLE photo_old_1');
$this->addSql('DROP TABLE photo_old_2');
$this->addSql('DROP TABLE zone_quartier_quartier');
$this->addSql('DROP TABLE zone_quartier_zone');
$this->addSql('ALTER TABLE adresse DROP FOREIGN KEY FK_C35F0816BC6D351B');
$this->addSql('DROP INDEX UNIQ_C35F0816BC6D351B ON adresse');
$this->addSql('ALTER TABLE adresse DROP pharmacie_id');
$this->addSql('ALTER TABLE facture_patient DROP FOREIGN KEY FK_523D76B282EA2E54');
$this->addSql('DROP INDEX uniq_523d76b282ea2e54 ON facture_patient');
$this->addSql('CREATE INDEX IDX_523D76B282EA2E54 ON facture_patient (commande_id)');
$this->addSql('ALTER TABLE facture_patient ADD CONSTRAINT FK_523D76B282EA2E54 FOREIGN KEY (commande_id) REFERENCES ictus_commande (id)');
$this->addSql('ALTER TABLE icto_remboursement ADD CONSTRAINT FK_FB668A9C90928347 FOREIGN KEY (type_paiement_demande_id) REFERENCES typepaiement (id)');
$this->addSql('ALTER TABLE icto_remboursement ADD CONSTRAINT FK_FB668A9CC628A558 FOREIGN KEY (type_paiement_obtenue_id) REFERENCES typepaiement (id)');
$this->addSql('ALTER TABLE ictus_panier_patient DROP FOREIGN KEY FK_5F09B1A92BF23B8F');
$this->addSql('ALTER TABLE ictus_panier_patient ADD CONSTRAINT FK_5F09B1A92BF23B8F FOREIGN KEY (ordonnance_id) REFERENCES ordonnance (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE photo CHANGE lien lien VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE photo_recuperer DROP is_copied, CHANGE createdat createdat DATETIME NOT NULL');
$this->addSql('ALTER TABLE photo_recuperer ADD CONSTRAINT FK_48C6193B61220EA6 FOREIGN KEY (creator_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE photo_recuperer ADD CONSTRAINT FK_48C6193BF347EFB FOREIGN KEY (produit_id) REFERENCES product (id)');
$this->addSql('DROP INDEX idx_14b7841861220ea6 ON photo_recuperer');
$this->addSql('CREATE INDEX IDX_48C6193B61220EA6 ON photo_recuperer (creator_id)');
$this->addSql('DROP INDEX idx_14b78418f347efb ON photo_recuperer');
$this->addSql('CREATE INDEX IDX_48C6193BF347EFB ON photo_recuperer (produit_id)');
$this->addSql('ALTER TABLE product DROP ordonnance');
$this->addSql('DROP INDEX IDX_FEE8962D9F2C3FAB ON quartier');
$this->addSql('ALTER TABLE quartier DROP zone_id');
$this->addSql('ALTER TABLE user CHANGE validate_code validate_code VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE zone_quartier DROP FOREIGN KEY FK_6E7AEB069F2C3FAB');
$this->addSql('ALTER TABLE zone_quartier DROP FOREIGN KEY FK_66CA0CA5DF1E57AB');
$this->addSql('ALTER TABLE zone_quartier DROP FOREIGN KEY FK_6E7AEB069F2C3FAB');
$this->addSql('ALTER TABLE zone_quartier DROP FOREIGN KEY FK_66CA0CA5DF1E57AB');
$this->addSql('ALTER TABLE zone_quartier ADD CONSTRAINT FK_D6541AB09F2C3FAB FOREIGN KEY (zone_id) REFERENCES zone (id)');
$this->addSql('ALTER TABLE zone_quartier ADD CONSTRAINT FK_D6541AB0DF1E57AB FOREIGN KEY (quartier_id) REFERENCES quartier (id)');
$this->addSql('DROP INDEX fk_6e7aeb069f2c3fab ON zone_quartier');
$this->addSql('CREATE INDEX IDX_D6541AB09F2C3FAB ON zone_quartier (zone_id)');
$this->addSql('DROP INDEX fk_66ca0ca5df1e57ab ON zone_quartier');
$this->addSql('CREATE INDEX IDX_D6541AB0DF1E57AB ON zone_quartier (quartier_id)');
$this->addSql('ALTER TABLE zone_quartier ADD CONSTRAINT FK_6E7AEB069F2C3FAB FOREIGN KEY (zone_id) REFERENCES zone (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE zone_quartier ADD CONSTRAINT FK_66CA0CA5DF1E57AB FOREIGN KEY (quartier_id) REFERENCES quartier (id) ON DELETE CASCADE');
*/
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE adherer (id INT AUTO_INCREMENT NOT NULL, assurance_id INT NOT NULL, nom VARCHAR(255) NOT NULL, prenom VARCHAR(255) DEFAULT NULL, numero VARCHAR(255) NOT NULL, prisencharge DOUBLE PRECISION NOT NULL, remarque LONGTEXT DEFAULT NULL, INDEX IDX_7786DD12B288C3E3 (assurance_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE assurance (id INT AUTO_INCREMENT NOT NULL, designation VARCHAR(255) NOT NULL, adresse VARCHAR(255) DEFAULT NULL, logo VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE assurance_ictus_pharmacie (assurance_id INT NOT NULL, ictus_pharmacie_id INT NOT NULL, INDEX IDX_494273A0B288C3E3 (assurance_id), INDEX IDX_494273A0196C0F6D (ictus_pharmacie_id), PRIMARY KEY(assurance_id, ictus_pharmacie_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE carte (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, assurance_id INT NOT NULL, numero VARCHAR(255) NOT NULL, INDEX IDX_BAD4FFFDA76ED395 (user_id), INDEX IDX_BAD4FFFDB288C3E3 (assurance_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE etat_prisencharge (id INT AUTO_INCREMENT NOT NULL, designation VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE historique_reglement (id INT AUTO_INCREMENT NOT NULL, type_paiement_id INT NOT NULL, prisencharge_id INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', montant DOUBLE PRECISION NOT NULL, INDEX IDX_B8978A04615593E9 (type_paiement_id), INDEX IDX_B8978A045DB07E12 (prisencharge_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE pris_en_charge (id INT AUTO_INCREMENT NOT NULL, assurance_id INT NOT NULL, etat_id INT NOT NULL, prisencharge DOUBLE PRECISION NOT NULL, remarque LONGTEXT DEFAULT NULL, INDEX IDX_99F95648B288C3E3 (assurance_id), INDEX IDX_99F95648D5E86FF (etat_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE adherer ADD CONSTRAINT FK_7786DD12B288C3E3 FOREIGN KEY (assurance_id) REFERENCES assurance (id)');
$this->addSql('ALTER TABLE assurance_ictus_pharmacie ADD CONSTRAINT FK_494273A0B288C3E3 FOREIGN KEY (assurance_id) REFERENCES assurance (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE assurance_ictus_pharmacie ADD CONSTRAINT FK_494273A0196C0F6D FOREIGN KEY (ictus_pharmacie_id) REFERENCES ictus_pharmacie (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE carte ADD CONSTRAINT FK_BAD4FFFDA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE carte ADD CONSTRAINT FK_BAD4FFFDB288C3E3 FOREIGN KEY (assurance_id) REFERENCES assurance (id)');
$this->addSql('ALTER TABLE historique_reglement ADD CONSTRAINT FK_B8978A04615593E9 FOREIGN KEY (type_paiement_id) REFERENCES ictus_type_paiement (id)');
$this->addSql('ALTER TABLE historique_reglement ADD CONSTRAINT FK_B8978A045DB07E12 FOREIGN KEY (prisencharge_id) REFERENCES pris_en_charge (id)');
$this->addSql('ALTER TABLE pris_en_charge ADD CONSTRAINT FK_99F95648B288C3E3 FOREIGN KEY (assurance_id) REFERENCES assurance (id)');
$this->addSql('ALTER TABLE pris_en_charge ADD CONSTRAINT FK_99F95648D5E86FF FOREIGN KEY (etat_id) REFERENCES etat_prisencharge (id)');
$this->addSql('ALTER TABLE facture_patient ADD prisencharge_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE facture_patient ADD CONSTRAINT FK_523D76B25DB07E12 FOREIGN KEY (prisencharge_id) REFERENCES pris_en_charge (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_523D76B25DB07E12 ON facture_patient (prisencharge_id)');
$this->addSql('ALTER TABLE ictus_commande ADD prisencharge_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE ictus_commande ADD CONSTRAINT FK_536D322C5DB07E12 FOREIGN KEY (prisencharge_id) REFERENCES pris_en_charge (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_536D322C5DB07E12 ON ictus_commande (prisencharge_id)');
$this->addSql('ALTER TABLE ictus_mobile_appareil ADD CONSTRAINT FK_8A8F36ECA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE facture_patient DROP FOREIGN KEY FK_523D76B25DB07E12');
$this->addSql('ALTER TABLE ictus_commande DROP FOREIGN KEY FK_536D322C5DB07E12');
$this->addSql('CREATE TABLE photo_old (id INT AUTO_INCREMENT NOT NULL, produit_id INT DEFAULT NULL, lien LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, creator_id INT DEFAULT NULL, createdat DATETIME DEFAULT NULL, isnotsure TINYINT(1) DEFAULT NULL, downloaded TINYINT(1) DEFAULT NULL, notdisponible TINYINT(1) DEFAULT NULL, INDEX IDX_14B78418F347EFB (produit_id), INDEX IDX_14B7841861220EA6 (creator_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE photo_old_1 (id INT AUTO_INCREMENT NOT NULL, produit_id INT DEFAULT NULL, lien LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, creator_id INT DEFAULT NULL, createdat DATETIME DEFAULT NULL, isnotsure TINYINT(1) DEFAULT NULL, downloaded TINYINT(1) DEFAULT NULL, notdisponible TINYINT(1) DEFAULT NULL, is_copied TINYINT(1) DEFAULT NULL, INDEX IDX_14B78418F347EFB (produit_id), INDEX IDX_14B7841861220EA6 (creator_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE photo_old_2 (id INT AUTO_INCREMENT NOT NULL, produit_id INT DEFAULT NULL, lien LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, creator_id INT DEFAULT NULL, createdat DATETIME DEFAULT NULL, isnotsure TINYINT(1) DEFAULT NULL, downloaded TINYINT(1) DEFAULT NULL, notdisponible TINYINT(1) DEFAULT NULL, is_copied TINYINT(1) DEFAULT NULL, INDEX IDX_14B78418F347EFB (produit_id), INDEX IDX_14B7841861220EA6 (creator_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE zone_quartier_quartier (zone_quartier_id INT NOT NULL, quartier_id INT NOT NULL, INDEX IDX_66CA0CA57F3454C0 (zone_quartier_id), INDEX IDX_66CA0CA5DF1E57AB (quartier_id), PRIMARY KEY(zone_quartier_id, quartier_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE zone_quartier_zone (zone_quartier_id INT NOT NULL, zone_id INT NOT NULL, INDEX IDX_6E7AEB067F3454C0 (zone_quartier_id), INDEX IDX_6E7AEB069F2C3FAB (zone_id), PRIMARY KEY(zone_quartier_id, zone_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE zone_quartier_zone ADD CONSTRAINT FK_6E7AEB067F3454C0 FOREIGN KEY (zone_quartier_id) REFERENCES zone_quartier (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE adherer DROP FOREIGN KEY FK_7786DD12B288C3E3');
$this->addSql('ALTER TABLE assurance_ictus_pharmacie DROP FOREIGN KEY FK_494273A0B288C3E3');
$this->addSql('ALTER TABLE assurance_ictus_pharmacie DROP FOREIGN KEY FK_494273A0196C0F6D');
$this->addSql('ALTER TABLE carte DROP FOREIGN KEY FK_BAD4FFFDA76ED395');
$this->addSql('ALTER TABLE carte DROP FOREIGN KEY FK_BAD4FFFDB288C3E3');
$this->addSql('ALTER TABLE historique_reglement DROP FOREIGN KEY FK_B8978A04615593E9');
$this->addSql('ALTER TABLE historique_reglement DROP FOREIGN KEY FK_B8978A045DB07E12');
$this->addSql('ALTER TABLE pris_en_charge DROP FOREIGN KEY FK_99F95648B288C3E3');
$this->addSql('ALTER TABLE pris_en_charge DROP FOREIGN KEY FK_99F95648D5E86FF');
$this->addSql('DROP TABLE adherer');
$this->addSql('DROP TABLE assurance');
$this->addSql('DROP TABLE assurance_ictus_pharmacie');
$this->addSql('DROP TABLE carte');
$this->addSql('DROP TABLE etat_prisencharge');
$this->addSql('DROP TABLE historique_reglement');
$this->addSql('DROP TABLE pris_en_charge');
$this->addSql('ALTER TABLE adresse ADD pharmacie_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE adresse ADD CONSTRAINT FK_C35F0816BC6D351B FOREIGN KEY (pharmacie_id) REFERENCES user (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_C35F0816BC6D351B ON adresse (pharmacie_id)');
$this->addSql('DROP INDEX UNIQ_523D76B25DB07E12 ON facture_patient');
$this->addSql('ALTER TABLE facture_patient DROP FOREIGN KEY FK_523D76B282EA2E54');
$this->addSql('ALTER TABLE facture_patient DROP prisencharge_id');
$this->addSql('DROP INDEX idx_523d76b282ea2e54 ON facture_patient');
$this->addSql('CREATE INDEX UNIQ_523D76B282EA2E54 ON facture_patient (commande_id)');
$this->addSql('ALTER TABLE facture_patient ADD CONSTRAINT FK_523D76B282EA2E54 FOREIGN KEY (commande_id) REFERENCES ictus_commande (id)');
$this->addSql('ALTER TABLE icto_remboursement DROP FOREIGN KEY FK_FB668A9C90928347');
$this->addSql('ALTER TABLE icto_remboursement DROP FOREIGN KEY FK_FB668A9CC628A558');
$this->addSql('DROP INDEX UNIQ_536D322C5DB07E12 ON ictus_commande');
$this->addSql('ALTER TABLE ictus_commande DROP prisencharge_id');
$this->addSql('ALTER TABLE ictus_mobile_appareil DROP FOREIGN KEY FK_8A8F36ECA76ED395');
$this->addSql('ALTER TABLE ictus_panier_patient DROP FOREIGN KEY FK_5F09B1A92BF23B8F');
$this->addSql('ALTER TABLE ictus_panier_patient ADD CONSTRAINT FK_5F09B1A92BF23B8F FOREIGN KEY (ordonnance_id) REFERENCES ordonnance (id)');
$this->addSql('ALTER TABLE photo CHANGE lien lien LONGTEXT NOT NULL');
$this->addSql('ALTER TABLE photo_recuperer DROP FOREIGN KEY FK_48C6193B61220EA6');
$this->addSql('ALTER TABLE photo_recuperer DROP FOREIGN KEY FK_48C6193BF347EFB');
$this->addSql('ALTER TABLE photo_recuperer DROP FOREIGN KEY FK_48C6193B61220EA6');
$this->addSql('ALTER TABLE photo_recuperer DROP FOREIGN KEY FK_48C6193BF347EFB');
$this->addSql('ALTER TABLE photo_recuperer ADD is_copied TINYINT(1) DEFAULT NULL, CHANGE createdat createdat DATETIME DEFAULT NULL');
$this->addSql('DROP INDEX idx_48c6193bf347efb ON photo_recuperer');
$this->addSql('CREATE INDEX IDX_14B78418F347EFB ON photo_recuperer (produit_id)');
$this->addSql('DROP INDEX idx_48c6193b61220ea6 ON photo_recuperer');
$this->addSql('CREATE INDEX IDX_14B7841861220EA6 ON photo_recuperer (creator_id)');
$this->addSql('ALTER TABLE photo_recuperer ADD CONSTRAINT FK_48C6193B61220EA6 FOREIGN KEY (creator_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE photo_recuperer ADD CONSTRAINT FK_48C6193BF347EFB FOREIGN KEY (produit_id) REFERENCES product (id)');
$this->addSql('ALTER TABLE product ADD ordonnance TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE quartier ADD zone_id INT DEFAULT NULL');
$this->addSql('CREATE INDEX IDX_FEE8962D9F2C3FAB ON quartier (zone_id)');
$this->addSql('ALTER TABLE user CHANGE validate_code validate_code VARCHAR(10) DEFAULT NULL');
$this->addSql('ALTER TABLE zone_quartier DROP FOREIGN KEY FK_D6541AB09F2C3FAB');
$this->addSql('ALTER TABLE zone_quartier DROP FOREIGN KEY FK_D6541AB0DF1E57AB');
$this->addSql('ALTER TABLE zone_quartier DROP FOREIGN KEY FK_D6541AB09F2C3FAB');
$this->addSql('ALTER TABLE zone_quartier DROP FOREIGN KEY FK_D6541AB0DF1E57AB');
$this->addSql('ALTER TABLE zone_quartier ADD CONSTRAINT FK_6E7AEB069F2C3FAB FOREIGN KEY (zone_id) REFERENCES zone (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE zone_quartier ADD CONSTRAINT FK_66CA0CA5DF1E57AB FOREIGN KEY (quartier_id) REFERENCES quartier (id) ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_d6541ab0df1e57ab ON zone_quartier');
$this->addSql('CREATE INDEX FK_66CA0CA5DF1E57AB ON zone_quartier (quartier_id)');
$this->addSql('DROP INDEX idx_d6541ab09f2c3fab ON zone_quartier');
$this->addSql('CREATE INDEX FK_6E7AEB069F2C3FAB ON zone_quartier (zone_id)');
$this->addSql('ALTER TABLE zone_quartier ADD CONSTRAINT FK_D6541AB09F2C3FAB FOREIGN KEY (zone_id) REFERENCES zone (id)');
$this->addSql('ALTER TABLE zone_quartier ADD CONSTRAINT FK_D6541AB0DF1E57AB FOREIGN KEY (quartier_id) REFERENCES quartier (id)');
}
}