<?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 Version20220622153629 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('ALTER TABLE faq_page DROP FOREIGN KEY FK_1114DE4639FCA6F9');
$this->addSql('DROP TABLE page_meta');
$this->addSql('DROP INDEX UNIQ_1114DE4639FCA6F9 ON faq_page');
$this->addSql('ALTER TABLE faq_page ADD og_title VARCHAR(255) DEFAULT NULL, ADD og_description LONGTEXT DEFAULT NULL, ADD keywords VARCHAR(500) DEFAULT NULL, ADD slug VARCHAR(255) DEFAULT NULL, ADD og_image_name VARCHAR(255) DEFAULT NULL, ADD updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, DROP meta_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE page_meta (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, description LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, keywords VARCHAR(500) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, slug VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, og_image_name VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE faq_page ADD meta_id INT NOT NULL, DROP og_title, DROP og_description, DROP keywords, DROP slug, DROP og_image_name, DROP updated_at');
$this->addSql('ALTER TABLE faq_page ADD CONSTRAINT FK_1114DE4639FCA6F9 FOREIGN KEY (meta_id) REFERENCES page_meta (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1114DE4639FCA6F9 ON faq_page (meta_id)');
}
}