src/Migrations/Version20210418144056.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 Version20210418144056 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 olymp_online (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, deleted TINYINT(1) DEFAULT \'0\' NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, owner_uuid VARCHAR(36) DEFAULT NULL, owner_active TINYINT(1) DEFAULT \'1\' NOT NULL, owner_deleted TINYINT(1) DEFAULT \'0\' NOT NULL, INDEX IDX_8A90EECFB03A8386 (created_by_id), INDEX IDX_8A90EECF896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE olymp_online_direction (id INT AUTO_INCREMENT NOT NULL, event_id INT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, caption VARCHAR(255) NOT NULL, description VARCHAR(255) DEFAULT NULL, form_js LONGTEXT DEFAULT NULL, deleted TINYINT(1) DEFAULT \'0\' NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, weight INT DEFAULT 10 NOT NULL, INDEX IDX_B707EB671F7E88B (event_id), INDEX IDX_B707EB6B03A8386 (created_by_id), INDEX IDX_B707EB6896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE olymp_online_participant (id INT AUTO_INCREMENT NOT NULL, region_id INT DEFAULT NULL, uuid VARCHAR(36) NOT NULL, confirmed TINYINT(1) NOT NULL, first_name VARCHAR(255) NOT NULL, middle_name VARCHAR(255) DEFAULT NULL, last_name VARCHAR(255) NOT NULL, birthday DATE DEFAULT NULL, phone VARCHAR(50) DEFAULT NULL, email VARCHAR(50) DEFAULT NULL, education VARCHAR(255) DEFAULT NULL, class VARCHAR(255) DEFAULT NULL, edu_organisation_type VARCHAR(255) DEFAULT NULL, edu_organisation VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, p_series VARCHAR(255) DEFAULT NULL, p_number VARCHAR(255) DEFAULT NULL, p_org VARCHAR(255) DEFAULT NULL, p_date DATETIME DEFAULT NULL, p_org_code VARCHAR(255) DEFAULT NULL, INDEX IDX_EC81141798260155 (region_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE olymp_online_participant_confirmation (id INT AUTO_INCREMENT NOT NULL, participant_id INT NOT NULL, type VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, sent_at DATE NOT NULL, confirmed TINYINT(1) NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_4FBD01349D1C3019 (participant_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE olymp_online ADD CONSTRAINT FK_8A90EECFB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE olymp_online ADD CONSTRAINT FK_8A90EECF896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE olymp_online_direction ADD CONSTRAINT FK_B707EB671F7E88B FOREIGN KEY (event_id) REFERENCES olymp_online (id)');
$this->addSql('ALTER TABLE olymp_online_direction ADD CONSTRAINT FK_B707EB6B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE olymp_online_direction ADD CONSTRAINT FK_B707EB6896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE olymp_online_participant ADD CONSTRAINT FK_EC81141798260155 FOREIGN KEY (region_id) REFERENCES federal_region (id)');
$this->addSql('ALTER TABLE olymp_online_participant_confirmation ADD CONSTRAINT FK_4FBD01349D1C3019 FOREIGN KEY (participant_id) REFERENCES olymp_online_participant (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE olymp_online_direction DROP FOREIGN KEY FK_B707EB671F7E88B');
$this->addSql('ALTER TABLE olymp_online_participant_confirmation DROP FOREIGN KEY FK_4FBD01349D1C3019');
$this->addSql('DROP TABLE olymp_online');
$this->addSql('DROP TABLE olymp_online_direction');
$this->addSql('DROP TABLE olymp_online_participant');
$this->addSql('DROP TABLE olymp_online_participant_confirmation');
}
}