<?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 Version20221013135355 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 person (id SERIAL NOT NULL, file_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, family VARCHAR(255) NOT NULL, patronymic VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_34DCD17693CB796C ON person (file_id)');
$this->addSql('COMMENT ON TABLE person IS \'Люди\'');
$this->addSql('COMMENT ON COLUMN person.name IS \'Имя\'');
$this->addSql('COMMENT ON COLUMN person.family IS \'Фамилия\'');
$this->addSql('COMMENT ON COLUMN person.patronymic IS \'Отчество\'');
$this->addSql('ALTER TABLE person ADD CONSTRAINT FK_34DCD17693CB796C FOREIGN KEY (file_id) REFERENCES file (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE person DROP CONSTRAINT FK_34DCD17693CB796C');
$this->addSql('DROP TABLE person');
}
}