migrations/Version20230321182743.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20230321182743 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         /*$this->addSql('ALTER TABLE chat DROP FOREIGN KEY FK_659DF2AA22BA975D');
  19.         $this->addSql('ALTER TABLE chat DROP FOREIGN KEY FK_659DF2AA49E67092');
  20.         $this->addSql('ALTER TABLE chat ADD CONSTRAINT FK_659DF2AA22BA975D FOREIGN KEY (participant_two_id) REFERENCES user_profile (id)');
  21.         $this->addSql('ALTER TABLE chat ADD CONSTRAINT FK_659DF2AA49E67092 FOREIGN KEY (participant_one_id) REFERENCES user_profile (id)');
  22.         $this->addSql('ALTER TABLE child DROP FOREIGN KEY FK_22B35429A76ED395');
  23.         $this->addSql('ALTER TABLE child ADD CONSTRAINT FK_22B35429A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
  24.         $this->addSql('ALTER TABLE post DROP FOREIGN KEY FK_5A8A6C8DCCFA12B8');
  25.         $this->addSql('ALTER TABLE post ADD CONSTRAINT FK_5A8A6C8DCCFA12B8 FOREIGN KEY (profile_id) REFERENCES user_profile (id)');
  26.         $this->addSql('ALTER TABLE post_comment DROP FOREIGN KEY FK_A99CE55F4B89032C');
  27.         $this->addSql('ALTER TABLE post_comment DROP FOREIGN KEY FK_A99CE55FCCFA12B8');
  28.         $this->addSql('ALTER TABLE post_comment DROP FOREIGN KEY FK_A99CE55F727ACA70');
  29.         $this->addSql('ALTER TABLE post_comment ADD CONSTRAINT FK_A99CE55F4B89032C FOREIGN KEY (post_id) REFERENCES post (id)');
  30.         $this->addSql('ALTER TABLE post_comment ADD CONSTRAINT FK_A99CE55FCCFA12B8 FOREIGN KEY (profile_id) REFERENCES user_profile (id)');
  31.         $this->addSql('ALTER TABLE post_comment ADD CONSTRAINT FK_A99CE55F727ACA70 FOREIGN KEY (parent_id) REFERENCES post_comment (id)');
  32.         $this->addSql('ALTER TABLE post_comment_media DROP FOREIGN KEY FK_DCC787EEDB1174D2');
  33.         $this->addSql('ALTER TABLE post_comment_media ADD CONSTRAINT FK_DCC787EEDB1174D2 FOREIGN KEY (post_comment_id) REFERENCES post_comment (id)');
  34.         $this->addSql('ALTER TABLE post_media DROP FOREIGN KEY FK_FD372DE34B89032C');
  35.         $this->addSql('ALTER TABLE post_media ADD CONSTRAINT FK_FD372DE34B89032C FOREIGN KEY (post_id) REFERENCES post (id)');
  36.         $this->addSql('ALTER TABLE post_profile_reaction DROP FOREIGN KEY FK_1E99B9EC4B89032C');
  37.         $this->addSql('ALTER TABLE post_profile_reaction DROP FOREIGN KEY FK_1E99B9ECDB1174D2');
  38.         $this->addSql('ALTER TABLE post_profile_reaction DROP FOREIGN KEY FK_1E99B9EC6B9DD454');
  39.         $this->addSql('ALTER TABLE post_profile_reaction ADD CONSTRAINT FK_1E99B9EC4B89032C FOREIGN KEY (post_id) REFERENCES post (id)');
  40.         $this->addSql('ALTER TABLE post_profile_reaction ADD CONSTRAINT FK_1E99B9ECDB1174D2 FOREIGN KEY (post_comment_id) REFERENCES post_comment (id)');
  41.         $this->addSql('ALTER TABLE post_profile_reaction ADD CONSTRAINT FK_1E99B9EC6B9DD454 FOREIGN KEY (user_profile_id) REFERENCES user_profile (id)');*/
  42.         $this->addSql('ALTER TABLE user ADD is_tribu TINYINT(1) NOT NULL');
  43.         /*$this->addSql('ALTER TABLE user_payment_methods DROP FOREIGN KEY FK_5D77950CA76ED395');
  44.         $this->addSql('ALTER TABLE user_payment_methods ADD CONSTRAINT FK_5D77950CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
  45.         $this->addSql('ALTER TABLE user_profile DROP FOREIGN KEY FK_D95AB405A76ED395');
  46.         $this->addSql('ALTER TABLE user_profile ADD CONSTRAINT FK_D95AB405A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
  47.         $this->addSql('ALTER TABLE user_profile_interests DROP FOREIGN KEY FK_8C3457BACCFA12B8');
  48.         $this->addSql('ALTER TABLE user_profile_interests ADD CONSTRAINT FK_8C3457BACCFA12B8 FOREIGN KEY (profile_id) REFERENCES user_profile (id)');
  49.         $this->addSql('ALTER TABLE user_profile_section DROP FOREIGN KEY FK_EC11C8FCCCFA12B8');
  50.         $this->addSql('ALTER TABLE user_profile_section ADD CONSTRAINT FK_EC11C8FCCCFA12B8 FOREIGN KEY (profile_id) REFERENCES user_profile (id)');
  51.         $this->addSql('ALTER TABLE user_subscription DROP FOREIGN KEY FK_230A18D1A76ED395');
  52.         $this->addSql('ALTER TABLE user_subscription ADD CONSTRAINT FK_230A18D1A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
  53.         $this->addSql('ALTER TABLE user_subscription_especial DROP FOREIGN KEY FK_8B848379A76ED395');
  54.         $this->addSql('ALTER TABLE user_subscription_especial ADD CONSTRAINT FK_8B848379A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');*/
  55.     }
  56.     public function down(Schema $schema): void
  57.     {
  58.         // this down() migration is auto-generated, please modify it to your needs
  59.         /*$this->addSql('ALTER TABLE chat DROP FOREIGN KEY FK_659DF2AA49E67092');
  60.         $this->addSql('ALTER TABLE chat DROP FOREIGN KEY FK_659DF2AA22BA975D');
  61.         $this->addSql('ALTER TABLE chat ADD CONSTRAINT FK_659DF2AA49E67092 FOREIGN KEY (participant_one_id) REFERENCES user_profile (id) ON DELETE CASCADE');
  62.         $this->addSql('ALTER TABLE chat ADD CONSTRAINT FK_659DF2AA22BA975D FOREIGN KEY (participant_two_id) REFERENCES user_profile (id) ON DELETE CASCADE');
  63.         $this->addSql('ALTER TABLE child DROP FOREIGN KEY FK_22B35429A76ED395');
  64.         $this->addSql('ALTER TABLE child ADD CONSTRAINT FK_22B35429A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
  65.         $this->addSql('ALTER TABLE post DROP FOREIGN KEY FK_5A8A6C8DCCFA12B8');
  66.         $this->addSql('ALTER TABLE post ADD CONSTRAINT FK_5A8A6C8DCCFA12B8 FOREIGN KEY (profile_id) REFERENCES user_profile (id) ON DELETE CASCADE');
  67.         $this->addSql('ALTER TABLE post_comment DROP FOREIGN KEY FK_A99CE55F4B89032C');
  68.         $this->addSql('ALTER TABLE post_comment DROP FOREIGN KEY FK_A99CE55FCCFA12B8');
  69.         $this->addSql('ALTER TABLE post_comment DROP FOREIGN KEY FK_A99CE55F727ACA70');
  70.         $this->addSql('ALTER TABLE post_comment ADD CONSTRAINT FK_A99CE55F4B89032C FOREIGN KEY (post_id) REFERENCES post (id) ON DELETE CASCADE');
  71.         $this->addSql('ALTER TABLE post_comment ADD CONSTRAINT FK_A99CE55FCCFA12B8 FOREIGN KEY (profile_id) REFERENCES user_profile (id) ON DELETE CASCADE');
  72.         $this->addSql('ALTER TABLE post_comment ADD CONSTRAINT FK_A99CE55F727ACA70 FOREIGN KEY (parent_id) REFERENCES post_comment (id) ON DELETE CASCADE');
  73.         $this->addSql('ALTER TABLE post_comment_media DROP FOREIGN KEY FK_DCC787EEDB1174D2');
  74.         $this->addSql('ALTER TABLE post_comment_media ADD CONSTRAINT FK_DCC787EEDB1174D2 FOREIGN KEY (post_comment_id) REFERENCES post_comment (id) ON DELETE CASCADE');
  75.         $this->addSql('ALTER TABLE post_media DROP FOREIGN KEY FK_FD372DE34B89032C');
  76.         $this->addSql('ALTER TABLE post_media ADD CONSTRAINT FK_FD372DE34B89032C FOREIGN KEY (post_id) REFERENCES post (id) ON DELETE CASCADE');
  77.         $this->addSql('ALTER TABLE post_profile_reaction DROP FOREIGN KEY FK_1E99B9EC4B89032C');
  78.         $this->addSql('ALTER TABLE post_profile_reaction DROP FOREIGN KEY FK_1E99B9EC6B9DD454');
  79.         $this->addSql('ALTER TABLE post_profile_reaction DROP FOREIGN KEY FK_1E99B9ECDB1174D2');
  80.         $this->addSql('ALTER TABLE post_profile_reaction ADD CONSTRAINT FK_1E99B9EC4B89032C FOREIGN KEY (post_id) REFERENCES post (id) ON DELETE CASCADE');
  81.         $this->addSql('ALTER TABLE post_profile_reaction ADD CONSTRAINT FK_1E99B9EC6B9DD454 FOREIGN KEY (user_profile_id) REFERENCES user_profile (id) ON DELETE CASCADE');
  82.         $this->addSql('ALTER TABLE post_profile_reaction ADD CONSTRAINT FK_1E99B9ECDB1174D2 FOREIGN KEY (post_comment_id) REFERENCES post_comment (id) ON DELETE CASCADE');*/
  83.         $this->addSql('ALTER TABLE user DROP is_tribu');
  84.       /*  $this->addSql('ALTER TABLE user_payment_methods DROP FOREIGN KEY FK_5D77950CA76ED395');
  85.         $this->addSql('ALTER TABLE user_payment_methods ADD CONSTRAINT FK_5D77950CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
  86.         $this->addSql('ALTER TABLE user_profile DROP FOREIGN KEY FK_D95AB405A76ED395');
  87.         $this->addSql('ALTER TABLE user_profile ADD CONSTRAINT FK_D95AB405A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
  88.         $this->addSql('ALTER TABLE user_profile_interests DROP FOREIGN KEY FK_8C3457BACCFA12B8');
  89.         $this->addSql('ALTER TABLE user_profile_interests ADD CONSTRAINT FK_8C3457BACCFA12B8 FOREIGN KEY (profile_id) REFERENCES user_profile (id) ON DELETE CASCADE');
  90.         $this->addSql('ALTER TABLE user_profile_section DROP FOREIGN KEY FK_EC11C8FCCCFA12B8');
  91.         $this->addSql('ALTER TABLE user_profile_section ADD CONSTRAINT FK_EC11C8FCCCFA12B8 FOREIGN KEY (profile_id) REFERENCES user_profile (id) ON DELETE CASCADE');
  92.         $this->addSql('ALTER TABLE user_subscription DROP FOREIGN KEY FK_230A18D1A76ED395');
  93.         $this->addSql('ALTER TABLE user_subscription ADD CONSTRAINT FK_230A18D1A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
  94.         $this->addSql('ALTER TABLE user_subscription_especial DROP FOREIGN KEY FK_8B848379A76ED395');
  95.         $this->addSql('ALTER TABLE user_subscription_especial ADD CONSTRAINT FK_8B848379A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');*/
  96.     }
  97. }