<?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 Version20230127121139 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 cal_address_area (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) DEFAULT NULL, label VARCHAR(50) DEFAULT NULL, description LONGTEXT DEFAULT NULL, latitude VARCHAR(50) DEFAULT NULL, longitude VARCHAR(50) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE cal_accommodation ADD address_area_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE cal_accommodation ADD CONSTRAINT FK_2AA160DDE6EAB704 FOREIGN KEY (address_area_id) REFERENCES cal_address_area (id)');
$this->addSql('CREATE INDEX IDX_2AA160DDE6EAB704 ON cal_accommodation (address_area_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cal_accommodation DROP FOREIGN KEY FK_2AA160DDE6EAB704');
$this->addSql('DROP TABLE cal_address_area');
$this->addSql('DROP INDEX IDX_2AA160DDE6EAB704 ON cal_accommodation');
$this->addSql('ALTER TABLE cal_accommodation DROP address_area_id');
}
}