<?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 Version20211006065303 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 block_children (id INT AUTO_INCREMENT NOT NULL, page_block_id INT NOT NULL, children_id INT NOT NULL, json_data LONGTEXT DEFAULT NULL, INDEX IDX_FBE84D556972852C (page_block_id), INDEX IDX_FBE84D553D3D2749 (children_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE reset_password_request (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, selector VARCHAR(20) NOT NULL, hashed_token VARCHAR(100) NOT NULL, requested_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', expires_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_7CE748AA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE block_children ADD CONSTRAINT FK_FBE84D556972852C FOREIGN KEY (page_block_id) REFERENCES page_block (id)');
$this->addSql('ALTER TABLE block_children ADD CONSTRAINT FK_FBE84D553D3D2749 FOREIGN KEY (children_id) REFERENCES block (id)');
$this->addSql('ALTER TABLE reset_password_request ADD CONSTRAINT FK_7CE748AA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE block ADD subBlock TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE user CHANGE email email VARCHAR(180) NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E7927C74 ON user (email)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE block_children');
$this->addSql('DROP TABLE reset_password_request');
$this->addSql('ALTER TABLE block DROP subBlock');
$this->addSql('DROP INDEX UNIQ_8D93D649E7927C74 ON user');
$this->addSql('ALTER TABLE user CHANGE email email VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
}
}