src/Migrations/Version20210811092249.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 Version20210811092249 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_attendant (id INT AUTO_INCREMENT NOT NULL, country_id INT DEFAULT NULL, region_id INT DEFAULT NULL, confirmed TINYINT(1) NOT NULL, first_name VARCHAR(255) NOT NULL, middle_name VARCHAR(255) DEFAULT NULL, last_name VARCHAR(255) NOT NULL, phone VARCHAR(50) DEFAULT NULL, email VARCHAR(50) DEFAULT NULL, education VARCHAR(255) DEFAULT NULL, address_registration LONGTEXT DEFAULT NULL, address_fact LONGTEXT DEFAULT NULL, is_test_data TINYINT(1) DEFAULT \'0\' NOT NULL, work_place VARCHAR(255) DEFAULT NULL, work_position 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_department_name LONGTEXT DEFAULT NULL, p_issue_date DATETIME DEFAULT NULL, p_department_code VARCHAR(255) DEFAULT NULL, INDEX IDX_876A2094F92F3E70 (country_id), INDEX IDX_876A209498260155 (region_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE olymp_online_attendant_participants (id INT AUTO_INCREMENT NOT NULL, participant_id INT NOT NULL, attendant_id INT NOT NULL, attorney_id INT DEFAULT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_5175FC5C9D1C3019 (participant_id), INDEX IDX_5175FC5C4DE0C235 (attendant_id), INDEX IDX_5175FC5C36175919 (attorney_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE olymp_online_attendant ADD CONSTRAINT FK_876A2094F92F3E70 FOREIGN KEY (country_id) REFERENCES country (id)');
$this->addSql('ALTER TABLE olymp_online_attendant ADD CONSTRAINT FK_876A209498260155 FOREIGN KEY (region_id) REFERENCES federal_region (id)');
$this->addSql('ALTER TABLE olymp_online_attendant_participants ADD CONSTRAINT FK_5175FC5C9D1C3019 FOREIGN KEY (participant_id) REFERENCES olymp_online_participant (id)');
$this->addSql('ALTER TABLE olymp_online_attendant_participants ADD CONSTRAINT FK_5175FC5C4DE0C235 FOREIGN KEY (attendant_id) REFERENCES olymp_online_attendant (id)');
$this->addSql('ALTER TABLE olymp_online_attendant_participants ADD CONSTRAINT FK_5175FC5C36175919 FOREIGN KEY (attorney_id) REFERENCES files (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_attendant_participants DROP FOREIGN KEY FK_5175FC5C4DE0C235');
$this->addSql('DROP TABLE olymp_online_attendant');
$this->addSql('DROP TABLE olymp_online_attendant_participants');
}
}