<?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 Version20240120110759 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 gallery_view (uid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', gallery_id INT DEFAULT NULL, timestamp DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_6DE283024E7AF8F (gallery_id), PRIMARY KEY(uid)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE gallery_view ADD CONSTRAINT FK_6DE283024E7AF8F FOREIGN KEY (gallery_id) REFERENCES gallery (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE gallery_view DROP FOREIGN KEY FK_6DE283024E7AF8F');
$this->addSql('DROP TABLE gallery_view');
}
}