<?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 Version20220125164107 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('DROP SEQUENCE integration__mapping_data_shoper_id_seq CASCADE');
$this->addSql('CREATE SEQUENCE integration__mapping_data_shoper_category_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE integration__mapping_data_shoper_product_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$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))');
$this->addSql('CREATE INDEX IDX_E30416C1DD03F01 ON integration__mapping_data_shoper_category (connection_id)');
$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))');
$this->addSql('CREATE INDEX IDX_4EFB0960DD03F01 ON integration__mapping_data_shoper_product (connection_id)');
$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');
$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');
$this->addSql('DROP TABLE integration__mapping_data_shoper');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('DROP SEQUENCE integration__mapping_data_shoper_category_id_seq CASCADE');
$this->addSql('DROP SEQUENCE integration__mapping_data_shoper_product_id_seq CASCADE');
$this->addSql('CREATE SEQUENCE integration__mapping_data_shoper_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$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))');
$this->addSql('CREATE INDEX idx_b0de0497dd03f01 ON integration__mapping_data_shoper (connection_id)');
$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');
$this->addSql('DROP TABLE integration__mapping_data_shoper_category');
$this->addSql('DROP TABLE integration__mapping_data_shoper_product');
}
}