migrations/Version20250522083202.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 Version20250522083202 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('CREATE TABLE user_case_participation (id UUID NOT NULL, case_id UUID DEFAULT NULL, user_id UUID DEFAULT NULL, created_by UUID DEFAULT NULL, updated_by UUID DEFAULT NULL, joined_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
  19.         $this->addSql('CREATE INDEX IDX_60F887ECCF10D4F5 ON user_case_participation (case_id)');
  20.         $this->addSql('CREATE INDEX IDX_60F887ECA76ED395 ON user_case_participation (user_id)');
  21.         $this->addSql('CREATE INDEX IDX_60F887ECDE12AB56 ON user_case_participation (created_by)');
  22.         $this->addSql('CREATE INDEX IDX_60F887EC16FE72E1 ON user_case_participation (updated_by)');
  23.         $this->addSql('COMMENT ON COLUMN user_case_participation.id IS \'(DC2Type:uuid)\'');
  24.         $this->addSql('COMMENT ON COLUMN user_case_participation.case_id IS \'(DC2Type:uuid)\'');
  25.         $this->addSql('COMMENT ON COLUMN user_case_participation.user_id IS \'(DC2Type:uuid)\'');
  26.         $this->addSql('COMMENT ON COLUMN user_case_participation.created_by IS \'(DC2Type:uuid)\'');
  27.         $this->addSql('COMMENT ON COLUMN user_case_participation.updated_by IS \'(DC2Type:uuid)\'');
  28.         $this->addSql('ALTER TABLE user_case_participation ADD CONSTRAINT FK_60F887ECCF10D4F5 FOREIGN KEY (case_id) REFERENCES case_entity (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  29.         $this->addSql('ALTER TABLE user_case_participation ADD CONSTRAINT FK_60F887ECA76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  30.         $this->addSql('ALTER TABLE user_case_participation ADD CONSTRAINT FK_60F887ECDE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  31.         $this->addSql('ALTER TABLE user_case_participation ADD CONSTRAINT FK_60F887EC16FE72E1 FOREIGN KEY (updated_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  32.     }
  33.     public function down(Schema $schema): void
  34.     {
  35.         // this down() migration is auto-generated, please modify it to your needs
  36.         $this->addSql('CREATE SCHEMA public');
  37.         $this->addSql('ALTER TABLE user_case_participation DROP CONSTRAINT FK_60F887ECCF10D4F5');
  38.         $this->addSql('ALTER TABLE user_case_participation DROP CONSTRAINT FK_60F887ECA76ED395');
  39.         $this->addSql('ALTER TABLE user_case_participation DROP CONSTRAINT FK_60F887ECDE12AB56');
  40.         $this->addSql('ALTER TABLE user_case_participation DROP CONSTRAINT FK_60F887EC16FE72E1');
  41.         $this->addSql('DROP TABLE user_case_participation');
  42.     }
  43. }