<?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 Version20250117131100 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 favorite (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, frame_id INT NOT NULL, position_id INT NOT NULL, INDEX IDX_68C58ED99395C3F3 (customer_id), INDEX IDX_68C58ED93FA3C347 (frame_id), INDEX IDX_68C58ED9DD842E46 (position_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE favorite ADD CONSTRAINT FK_68C58ED99395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE favorite ADD CONSTRAINT FK_68C58ED93FA3C347 FOREIGN KEY (frame_id) REFERENCES frame (id)');
$this->addSql('ALTER TABLE favorite ADD CONSTRAINT FK_68C58ED9DD842E46 FOREIGN KEY (position_id) REFERENCES position (id)');
$this->addSql('ALTER TABLE customer CHANGE gallery_images gallery_images JSON DEFAULT NULL');
$this->addSql('ALTER TABLE tray CHANGE genders genders JSON DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE favorite');
$this->addSql('ALTER TABLE customer CHANGE gallery_images gallery_images LONGTEXT DEFAULT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE tray CHANGE genders genders LONGTEXT DEFAULT NULL COLLATE `utf8mb4_bin`');
}
}