<?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 Version20220424173905 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('ALTER TABLE category ADD CONSTRAINT FK_64C19C1B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE category ADD CONSTRAINT FK_64C19C1896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE category ADD CONSTRAINT FK_64C19C1727ACA70 FOREIGN KEY (parent_id) REFERENCES category (id)');
$this->addSql('ALTER TABLE company ADD CONSTRAINT FK_4FBF094FF0B5AF0B FOREIGN KEY (createdby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE company ADD CONSTRAINT FK_4FBF094FA43E35E8 FOREIGN KEY (updatedby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE enquete ADD CONSTRAINT FK_D6D86B295EE01E44 FOREIGN KEY (created_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE enquete ADD CONSTRAINT FK_D6D86B29960CC7F3 FOREIGN KEY (updated_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE enquete ADD CONSTRAINT FK_D6D86B29979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE label ADD CONSTRAINT FK_EA750E87663CD76 FOREIGN KEY (createby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE label ADD CONSTRAINT FK_EA750E8A43E35E8 FOREIGN KEY (updatedby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE language ADD CONSTRAINT FK_D4DB71B5A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE language_post ADD CONSTRAINT FK_688386C182F1BAF4 FOREIGN KEY (language_id) REFERENCES language (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE language_post ADD CONSTRAINT FK_688386C14B89032C FOREIGN KEY (post_id) REFERENCES post (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE language_category ADD CONSTRAINT FK_6AEE41FB82F1BAF4 FOREIGN KEY (language_id) REFERENCES language (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE language_category ADD CONSTRAINT FK_6AEE41FB12469DE2 FOREIGN KEY (category_id) REFERENCES category (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE media ADD CONSTRAINT FK_6A2CA10C4B89032C FOREIGN KEY (post_id) REFERENCES post (id)');
$this->addSql('ALTER TABLE media ADD CONSTRAINT FK_6A2CA10CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE place ADD CONSTRAINT FK_741D53CD727ACA70 FOREIGN KEY (parent_id) REFERENCES place (id)');
$this->addSql('ALTER TABLE place ADD CONSTRAINT FK_741D53CDF93A8DEF FOREIGN KEY (addby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE place ADD CONSTRAINT FK_741D53CD23AE0780 FOREIGN KEY (updateby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE post ADD icon VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE post ADD CONSTRAINT FK_5A8A6C8DA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE post ADD CONSTRAINT FK_5A8A6C8DF675F31B FOREIGN KEY (author_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE post ADD CONSTRAINT FK_5A8A6C8D727ACA70 FOREIGN KEY (parent_id) REFERENCES post (id)');
$this->addSql('ALTER TABLE post_category ADD CONSTRAINT FK_B9A190604B89032C FOREIGN KEY (post_id) REFERENCES post (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE post_category ADD CONSTRAINT FK_B9A1906012469DE2 FOREIGN KEY (category_id) REFERENCES category (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE question ADD CONSTRAINT FK_B6F7494E7663CD76 FOREIGN KEY (createby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE question ADD CONSTRAINT FK_B6F7494E23AE0780 FOREIGN KEY (updateby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE question ADD CONSTRAINT FK_B6F7494E158E0B66 FOREIGN KEY (target_id) REFERENCES target (id)');
$this->addSql('ALTER TABLE response ADD CONSTRAINT FK_3E7B0BFB1E27F6BF FOREIGN KEY (question_id) REFERENCES question (id)');
$this->addSql('ALTER TABLE response ADD CONSTRAINT FK_3E7B0BFBF0B5AF0B FOREIGN KEY (createdby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE response ADD CONSTRAINT FK_3E7B0BFBA43E35E8 FOREIGN KEY (updatedby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE target ADD CONSTRAINT FK_466F2FFCF0B5AF0B FOREIGN KEY (createdby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE target ADD CONSTRAINT FK_466F2FFCA43E35E8 FOREIGN KEY (updatedby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE travel_program ADD CONSTRAINT FK_53AEC095F93A8DEF FOREIGN KEY (addby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE travel_program ADD CONSTRAINT FK_53AEC09523AE0780 FOREIGN KEY (updateby_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE travel_program ADD CONSTRAINT FK_53AEC095DA6A219 FOREIGN KEY (place_id) REFERENCES place (id)');
$this->addSql('ALTER TABLE travel_program ADD CONSTRAINT FK_53AEC0957C70A796 FOREIGN KEY (arrival_location_id) REFERENCES place (id)');
$this->addSql('ALTER TABLE user CHANGE roles roles JSON NOT NULL');
$this->addSql('ALTER TABLE userresponse ADD CONSTRAINT FK_123EF48CFBF32840 FOREIGN KEY (response_id) REFERENCES response (id)');
$this->addSql('ALTER TABLE userresponse ADD CONSTRAINT FK_123EF48CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE category DROP FOREIGN KEY FK_64C19C1B03A8386');
$this->addSql('ALTER TABLE category DROP FOREIGN KEY FK_64C19C1896DBBDE');
$this->addSql('ALTER TABLE category DROP FOREIGN KEY FK_64C19C1727ACA70');
$this->addSql('ALTER TABLE company DROP FOREIGN KEY FK_4FBF094FF0B5AF0B');
$this->addSql('ALTER TABLE company DROP FOREIGN KEY FK_4FBF094FA43E35E8');
$this->addSql('ALTER TABLE enquete DROP FOREIGN KEY FK_D6D86B295EE01E44');
$this->addSql('ALTER TABLE enquete DROP FOREIGN KEY FK_D6D86B29960CC7F3');
$this->addSql('ALTER TABLE enquete DROP FOREIGN KEY FK_D6D86B29979B1AD6');
$this->addSql('ALTER TABLE label DROP FOREIGN KEY FK_EA750E87663CD76');
$this->addSql('ALTER TABLE label DROP FOREIGN KEY FK_EA750E8A43E35E8');
$this->addSql('ALTER TABLE language DROP FOREIGN KEY FK_D4DB71B5A76ED395');
$this->addSql('ALTER TABLE language_category DROP FOREIGN KEY FK_6AEE41FB82F1BAF4');
$this->addSql('ALTER TABLE language_category DROP FOREIGN KEY FK_6AEE41FB12469DE2');
$this->addSql('ALTER TABLE language_post DROP FOREIGN KEY FK_688386C182F1BAF4');
$this->addSql('ALTER TABLE language_post DROP FOREIGN KEY FK_688386C14B89032C');
$this->addSql('ALTER TABLE media DROP FOREIGN KEY FK_6A2CA10C4B89032C');
$this->addSql('ALTER TABLE media DROP FOREIGN KEY FK_6A2CA10CA76ED395');
$this->addSql('ALTER TABLE place DROP FOREIGN KEY FK_741D53CD727ACA70');
$this->addSql('ALTER TABLE place DROP FOREIGN KEY FK_741D53CDF93A8DEF');
$this->addSql('ALTER TABLE place DROP FOREIGN KEY FK_741D53CD23AE0780');
$this->addSql('ALTER TABLE post DROP FOREIGN KEY FK_5A8A6C8DA76ED395');
$this->addSql('ALTER TABLE post DROP FOREIGN KEY FK_5A8A6C8DF675F31B');
$this->addSql('ALTER TABLE post DROP FOREIGN KEY FK_5A8A6C8D727ACA70');
$this->addSql('ALTER TABLE post DROP icon');
$this->addSql('ALTER TABLE post_category DROP FOREIGN KEY FK_B9A190604B89032C');
$this->addSql('ALTER TABLE post_category DROP FOREIGN KEY FK_B9A1906012469DE2');
$this->addSql('ALTER TABLE question DROP FOREIGN KEY FK_B6F7494E7663CD76');
$this->addSql('ALTER TABLE question DROP FOREIGN KEY FK_B6F7494E23AE0780');
$this->addSql('ALTER TABLE question DROP FOREIGN KEY FK_B6F7494E158E0B66');
$this->addSql('ALTER TABLE response DROP FOREIGN KEY FK_3E7B0BFB1E27F6BF');
$this->addSql('ALTER TABLE response DROP FOREIGN KEY FK_3E7B0BFBF0B5AF0B');
$this->addSql('ALTER TABLE response DROP FOREIGN KEY FK_3E7B0BFBA43E35E8');
$this->addSql('ALTER TABLE target DROP FOREIGN KEY FK_466F2FFCF0B5AF0B');
$this->addSql('ALTER TABLE target DROP FOREIGN KEY FK_466F2FFCA43E35E8');
$this->addSql('ALTER TABLE travel_program DROP FOREIGN KEY FK_53AEC095F93A8DEF');
$this->addSql('ALTER TABLE travel_program DROP FOREIGN KEY FK_53AEC09523AE0780');
$this->addSql('ALTER TABLE travel_program DROP FOREIGN KEY FK_53AEC095DA6A219');
$this->addSql('ALTER TABLE travel_program DROP FOREIGN KEY FK_53AEC0957C70A796');
$this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT NOT NULL');
$this->addSql('ALTER TABLE userresponse DROP FOREIGN KEY FK_123EF48CFBF32840');
$this->addSql('ALTER TABLE userresponse DROP FOREIGN KEY FK_123EF48CA76ED395');
}
}