<?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 Version20230220025042 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 interest_point (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, address VARCHAR(255) DEFAULT NULL, mail VARCHAR(255) DEFAULT NULL, website VARCHAR(255) DEFAULT NULL, lat_long VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE interest_point_category_interest_point (interest_point_id INT NOT NULL, category_interest_point_id INT NOT NULL, INDEX IDX_EADA4EF5BCFB5B62 (interest_point_id), INDEX IDX_EADA4EF556AB21E2 (category_interest_point_id), PRIMARY KEY(interest_point_id, category_interest_point_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE interest_point_category_interest_point ADD CONSTRAINT FK_EADA4EF5BCFB5B62 FOREIGN KEY (interest_point_id) REFERENCES interest_point (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE interest_point_category_interest_point ADD CONSTRAINT FK_EADA4EF556AB21E2 FOREIGN KEY (category_interest_point_id) REFERENCES category_interest_point (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE interest_point_category_interest_point DROP FOREIGN KEY FK_EADA4EF5BCFB5B62');
$this->addSql('ALTER TABLE interest_point_category_interest_point DROP FOREIGN KEY FK_EADA4EF556AB21E2');
$this->addSql('DROP TABLE interest_point');
$this->addSql('DROP TABLE interest_point_category_interest_point');
}
}