<?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 Version20220419103557 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('CREATE TABLE shop_settings (id INT AUTO_INCREMENT NOT NULL, shop_id INT DEFAULT NULL, email_notification TINYINT(1) NOT NULL, future_orders TINYINT(1) NOT NULL, display_foxeat TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_3EFD5A534D16C4DD (shop_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE shop_settings ADD CONSTRAINT FK_3EFD5A534D16C4DD FOREIGN KEY (shop_id) REFERENCES shop (id)');
$this->addSql('ALTER TABLE currency DROP FOREIGN KEY FK_6956883F523CAB89');
$this->addSql('DROP INDEX UNIQ_6956883F523CAB89 ON currency');
$this->addSql('ALTER TABLE currency ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL, DROP franchise_id, DROP value, DROP create_at, DROP edited_at');
$this->addSql('ALTER TABLE shop ADD currency_id INT DEFAULT NULL, ADD time_zone VARCHAR(50) NOT NULL, ADD siret VARCHAR(20) NOT NULL, ADD communication_mode VARCHAR(50) DEFAULT NULL, ADD enabled TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE shop ADD CONSTRAINT FK_AC6A4CA238248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
$this->addSql('CREATE INDEX IDX_AC6A4CA238248176 ON shop (currency_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE shop_settings');
$this->addSql('ALTER TABLE currency ADD franchise_id INT NOT NULL, ADD value DOUBLE PRECISION NOT NULL, ADD create_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', ADD edited_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', DROP created_at, DROP updated_at');
$this->addSql('ALTER TABLE currency ADD CONSTRAINT FK_6956883F523CAB89 FOREIGN KEY (franchise_id) REFERENCES franchise (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6956883F523CAB89 ON currency (franchise_id)');
$this->addSql('ALTER TABLE shop DROP FOREIGN KEY FK_AC6A4CA238248176');
$this->addSql('DROP INDEX IDX_AC6A4CA238248176 ON shop');
$this->addSql('ALTER TABLE shop DROP currency_id, DROP time_zone, DROP siret, DROP communication_mode, DROP enabled');
}
}