src/Migrations/Version20201025201842.php line 1
<?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 Version20201025201842 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 university_categories (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, caption VARCHAR(255) NOT NULL, deleted TINYINT(1) DEFAULT \'0\' NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, active TINYINT(1) DEFAULT \'1\' NOT NULL, INDEX IDX_BB7BEBF2B03A8386 (created_by_id), INDEX IDX_BB7BEBF2896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE university_category_organisation (university_category_id INT NOT NULL, organisation_id INT NOT NULL, INDEX IDX_19341E8421D6F15 (university_category_id), INDEX IDX_19341E849E6B1585 (organisation_id), PRIMARY KEY(university_category_id, organisation_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE university_categories ADD CONSTRAINT FK_BB7BEBF2B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE university_categories ADD CONSTRAINT FK_BB7BEBF2896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE university_category_organisation ADD CONSTRAINT FK_19341E8421D6F15 FOREIGN KEY (university_category_id) REFERENCES university_categories (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE university_category_organisation ADD CONSTRAINT FK_19341E849E6B1585 FOREIGN KEY (organisation_id) REFERENCES organisation (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE news_type CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE olympiad CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE olympiad_category CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE olympiad_discipline CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE olympiad_grade CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE olympiad_level CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE olympiad_stage CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE organisation ADD have_dorm TINYINT(1) NOT NULL, ADD have_military_department TINYINT(1) NOT NULL, ADD coord_lat DOUBLE PRECISION DEFAULT NULL, ADD coord_lng DOUBLE PRECISION DEFAULT NULL, CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE organisation_page CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE organisation_page_type CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE scholar_competence CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE scholar_profile CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE static_page CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE users CHANGE active active TINYINT(1) DEFAULT \'1\' NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE university_category_organisation DROP FOREIGN KEY FK_19341E8421D6F15');
$this->addSql('DROP TABLE university_categories');
$this->addSql('DROP TABLE university_category_organisation');
$this->addSql('ALTER TABLE news_type CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE olympiad CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE olympiad_category CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE olympiad_discipline CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE olympiad_grade CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE olympiad_level CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE olympiad_stage CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE organisation DROP have_dorm, DROP have_military_department, DROP coord_lat, DROP coord_lng, CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE organisation_page CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE organisation_page_type CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE scholar_competence CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE scholar_profile CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE static_page CHANGE active active TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE users CHANGE active active TINYINT(1) NOT NULL');
}
}