<?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 Version20231130141903 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 sport_tatarstan_imported_federations (id SERIAL NOT NULL, organization_id INT DEFAULT NULL, phone TEXT DEFAULT NULL, email TEXT DEFAULT NULL, site_url TEXT DEFAULT NULL, image_url TEXT DEFAULT NULL, external_link TEXT DEFAULT NULL, import_status VARCHAR(255) DEFAULT NULL, yandex_id VARCHAR(255) DEFAULT NULL, name TEXT DEFAULT NULL, reject_reason TEXT DEFAULT NULL, source TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B5F4D8CC32C8A3DE ON sport_tatarstan_imported_federations (organization_id)');
$this->addSql('CREATE TABLE sport_tatarstan_imported_objects (id SERIAL NOT NULL, sport_object_id INT DEFAULT NULL, organization_id INT DEFAULT NULL, phone TEXT DEFAULT NULL, email TEXT DEFAULT NULL, site_url TEXT DEFAULT NULL, slider_images JSON DEFAULT NULL, description TEXT DEFAULT NULL, visiting_requirements TEXT DEFAULT NULL, object_composition TEXT DEFAULT NULL, available_environment TEXT DEFAULT NULL, ownership_type TEXT DEFAULT NULL, external_link TEXT DEFAULT NULL, import_status VARCHAR(255) DEFAULT NULL, yandex_id VARCHAR(255) DEFAULT NULL, name TEXT DEFAULT NULL, yandex_data TEXT DEFAULT NULL, reject_reason TEXT DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, source TEXT DEFAULT NULL, legal_entity_info TEXT DEFAULT NULL, head_full_name JSON DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_3ED262C78AFAE46 ON sport_tatarstan_imported_objects (sport_object_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_3ED262C732C8A3DE ON sport_tatarstan_imported_objects (organization_id)');
$this->addSql('ALTER TABLE sport_tatarstan_imported_federations ADD CONSTRAINT FK_B5F4D8CC32C8A3DE FOREIGN KEY (organization_id) REFERENCES organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE sport_tatarstan_imported_objects ADD CONSTRAINT FK_3ED262C78AFAE46 FOREIGN KEY (sport_object_id) REFERENCES sport_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE sport_tatarstan_imported_objects ADD CONSTRAINT FK_3ED262C732C8A3DE FOREIGN KEY (organization_id) REFERENCES organization (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('CREATE SCHEMA public');
$this->addSql('ALTER TABLE sport_tatarstan_imported_federations DROP CONSTRAINT FK_B5F4D8CC32C8A3DE');
$this->addSql('ALTER TABLE sport_tatarstan_imported_objects DROP CONSTRAINT FK_3ED262C78AFAE46');
$this->addSql('ALTER TABLE sport_tatarstan_imported_objects DROP CONSTRAINT FK_3ED262C732C8A3DE');
$this->addSql('DROP TABLE sport_tatarstan_imported_federations');
$this->addSql('DROP TABLE sport_tatarstan_imported_objects');
}
}