migrations/Version20220125164107.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 Version20220125164107 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('DROP SEQUENCE integration__mapping_data_shoper_id_seq CASCADE');
  19.         $this->addSql('CREATE SEQUENCE integration__mapping_data_shoper_category_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  20.         $this->addSql('CREATE SEQUENCE integration__mapping_data_shoper_product_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  21.         $this->addSql('CREATE TABLE integration__mapping_data_shoper_category (id INT NOT NULL, connection_id INT DEFAULT NULL, shoper_category_id INT NOT NULL, shoper_category_name VARCHAR(250) NOT NULL, shoper_category_root BOOLEAN DEFAULT false NOT NULL, pim_category_id INT DEFAULT NULL, pim_category_name VARCHAR(250) DEFAULT NULL, PRIMARY KEY(id))');
  22.         $this->addSql('CREATE INDEX IDX_E30416C1DD03F01 ON integration__mapping_data_shoper_category (connection_id)');
  23.         $this->addSql('CREATE TABLE integration__mapping_data_shoper_product (id INT NOT NULL, connection_id INT DEFAULT NULL, shoper_id INT NOT NULL, pim_id INT DEFAULT NULL, PRIMARY KEY(id))');
  24.         $this->addSql('CREATE INDEX IDX_4EFB0960DD03F01 ON integration__mapping_data_shoper_product (connection_id)');
  25.         $this->addSql('ALTER TABLE integration__mapping_data_shoper_category ADD CONSTRAINT FK_E30416C1DD03F01 FOREIGN KEY (connection_id) REFERENCES integration__connection_shoper (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
  26.         $this->addSql('ALTER TABLE integration__mapping_data_shoper_product ADD CONSTRAINT FK_4EFB0960DD03F01 FOREIGN KEY (connection_id) REFERENCES integration__connection_shoper (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
  27.         $this->addSql('DROP TABLE integration__mapping_data_shoper');
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->addSql('CREATE SCHEMA public');
  33.         $this->addSql('DROP SEQUENCE integration__mapping_data_shoper_category_id_seq CASCADE');
  34.         $this->addSql('DROP SEQUENCE integration__mapping_data_shoper_product_id_seq CASCADE');
  35.         $this->addSql('CREATE SEQUENCE integration__mapping_data_shoper_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  36.         $this->addSql('CREATE TABLE integration__mapping_data_shoper (id INT NOT NULL, connection_id INT DEFAULT NULL, shoper_category_id INT NOT NULL, shoper_category_name VARCHAR(250) NOT NULL, shoper_category_root BOOLEAN DEFAULT false NOT NULL, pim_category_id INT DEFAULT NULL, pim_category_name VARCHAR(250) DEFAULT NULL, PRIMARY KEY(id))');
  37.         $this->addSql('CREATE INDEX idx_b0de0497dd03f01 ON integration__mapping_data_shoper (connection_id)');
  38.         $this->addSql('ALTER TABLE integration__mapping_data_shoper ADD CONSTRAINT fk_b0de0497dd03f01 FOREIGN KEY (connection_id) REFERENCES integration__connection_shoper (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
  39.         $this->addSql('DROP TABLE integration__mapping_data_shoper_category');
  40.         $this->addSql('DROP TABLE integration__mapping_data_shoper_product');
  41.     }
  42. }