<?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 Version20251030120423 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('ALTER TABLE ictus_commande_line ADD is_prisencharge TINYINT(1) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$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_6E7AEB069F2C3FAB (zone_id), INDEX IDX_6E7AEB067F3454C0 (zone_quartier_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 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('ALTER TABLE facture_patient DROP FOREIGN KEY FK_523D76B282EA2E54');
$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('ALTER TABLE ictus_commande_line DROP is_prisencharge');
$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_48c6193b61220ea6 ON photo_recuperer');
$this->addSql('CREATE INDEX IDX_14B7841861220EA6 ON photo_recuperer (creator_id)');
$this->addSql('DROP INDEX idx_48c6193bf347efb ON photo_recuperer');
$this->addSql('CREATE INDEX IDX_14B78418F347EFB ON photo_recuperer (produit_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_d6541ab09f2c3fab ON zone_quartier');
$this->addSql('CREATE INDEX FK_6E7AEB069F2C3FAB ON zone_quartier (zone_id)');
$this->addSql('DROP INDEX idx_d6541ab0df1e57ab ON zone_quartier');
$this->addSql('CREATE INDEX FK_66CA0CA5DF1E57AB ON zone_quartier (quartier_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)');
}
}