<?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 Version20250604102249 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 super_administrator (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE super_administrator ADD CONSTRAINT FK_8340D138BF396750 FOREIGN KEY (id) REFERENCES `user` (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE administrator ADD shop_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE administrator ADD CONSTRAINT FK_58DF06514D16C4DD FOREIGN KEY (shop_id) REFERENCES shop (id)');
$this->addSql('CREATE INDEX IDX_58DF06514D16C4DD ON administrator (shop_id)');
$this->addSql('ALTER TABLE collection CHANGE genders genders JSON NOT NULL');
$this->addSql('ALTER TABLE frame CHANGE nose_size nose_size JSON NOT NULL');
$this->addSql('ALTER TABLE user CHANGE roles roles JSON NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE super_administrator DROP FOREIGN KEY FK_8340D138BF396750');
$this->addSql('DROP TABLE super_administrator');
$this->addSql('ALTER TABLE administrator DROP FOREIGN KEY FK_58DF06514D16C4DD');
$this->addSql('DROP INDEX IDX_58DF06514D16C4DD ON administrator');
$this->addSql('ALTER TABLE administrator DROP shop_id');
$this->addSql('ALTER TABLE collection CHANGE genders genders JSON NOT NULL');
$this->addSql('ALTER TABLE frame CHANGE nose_size nose_size JSON NOT NULL');
$this->addSql('ALTER TABLE `user` CHANGE roles roles JSON NOT NULL');
}
}