<?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 Version20220912163915 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 SEQUENCE property_description_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE property_description (id INT NOT NULL, property_id INT DEFAULT NULL, local VARCHAR(255) NOT NULL, content TEXT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_D2818010549213EC ON property_description (property_id)');
$this->addSql('ALTER TABLE property_description ADD CONSTRAINT FK_D2818010549213EC FOREIGN KEY (property_id) REFERENCES property (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE property ADD bathroom_number INT DEFAULT NULL');
$this->addSql('ALTER TABLE property ADD number_of_rooms INT DEFAULT NULL');
$this->addSql('ALTER TABLE property ADD number_of_pieces INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('DROP SEQUENCE property_description_id_seq CASCADE');
$this->addSql('DROP TABLE property_description');
$this->addSql('ALTER TABLE property DROP bathroom_number');
$this->addSql('ALTER TABLE property DROP number_of_rooms');
$this->addSql('ALTER TABLE property DROP number_of_pieces');
}
}