<?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 Version20230111212436 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 mobile_parent_app_account_activity (id INT AUTO_INCREMENT NOT NULL, mobile_parent_app_account_id INT DEFAULT NULL, type VARCHAR(128) DEFAULT NULL, description LONGTEXT DEFAULT NULL, create_at DATE DEFAULT NULL COMMENT \'(DC2Type:date_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_by INT NOT NULL, updated_by INT NOT NULL, INDEX IDX_A3DD3B2BD12D991B (mobile_parent_app_account_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE mobile_parent_app_account_activity ADD CONSTRAINT FK_A3DD3B2BD12D991B FOREIGN KEY (mobile_parent_app_account_id) REFERENCES mobile_parent_app_account (id)');
$this->addSql('ALTER TABLE equivalent_matter ADD parent_id INT DEFAULT NULL, ADD num_order INT DEFAULT NULL');
$this->addSql('ALTER TABLE equivalent_matter ADD CONSTRAINT FK_842652C2727ACA70 FOREIGN KEY (parent_id) REFERENCES equivalent_matter (id)');
$this->addSql('CREATE INDEX IDX_842652C2727ACA70 ON equivalent_matter (parent_id)');
$this->addSql('ALTER TABLE school_sub_matter ADD equivalent_matter_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE school_sub_matter ADD CONSTRAINT FK_B72E54D1AEEA3DB1 FOREIGN KEY (equivalent_matter_id) REFERENCES equivalent_matter (id)');
$this->addSql('CREATE INDEX IDX_B72E54D1AEEA3DB1 ON school_sub_matter (equivalent_matter_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE mobile_parent_app_account_activity');
$this->addSql('ALTER TABLE equivalent_matter DROP FOREIGN KEY FK_842652C2727ACA70');
$this->addSql('DROP INDEX IDX_842652C2727ACA70 ON equivalent_matter');
$this->addSql('ALTER TABLE equivalent_matter DROP parent_id, DROP num_order');
$this->addSql('ALTER TABLE school_sub_matter DROP FOREIGN KEY FK_B72E54D1AEEA3DB1');
$this->addSql('DROP INDEX IDX_B72E54D1AEEA3DB1 ON school_sub_matter');
$this->addSql('ALTER TABLE school_sub_matter DROP equivalent_matter_id');
}
}