migrations/Version20250128165120.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 Version20250128165120 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('CREATE TABLE service_attachment_position (id UUID NOT NULL, payment_id UUID DEFAULT NULL, service_id UUID NOT NULL, name VARCHAR(255) DEFAULT NULL, position INT NOT NULL, is_required BOOLEAN NOT NULL, PRIMARY KEY(id))');
  18.         $this->addSql('CREATE INDEX IDX_83A8992F4C3A3BB ON service_attachment_position (payment_id)');
  19.         $this->addSql('CREATE INDEX IDX_83A8992FED5CA9E6 ON service_attachment_position (service_id)');
  20.         $this->addSql('COMMENT ON COLUMN service_attachment_position.id IS \'(DC2Type:uuid)\'');
  21.         $this->addSql('COMMENT ON COLUMN service_attachment_position.payment_id IS \'(DC2Type:uuid)\'');
  22.         $this->addSql('COMMENT ON COLUMN service_attachment_position.service_id IS \'(DC2Type:uuid)\'');
  23.         $this->addSql('ALTER TABLE service_attachment_position ADD CONSTRAINT FK_83A8992F4C3A3BB FOREIGN KEY (payment_id) REFERENCES abap_payment_position (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  24.         $this->addSql('ALTER TABLE service_attachment_position ADD CONSTRAINT FK_83A8992FED5CA9E6 FOREIGN KEY (service_id) REFERENCES service (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  25.         $this->addSql('ALTER TABLE application_attachment ADD service_attachment_position_id UUID DEFAULT NULL');
  26.         $this->addSql('COMMENT ON COLUMN application_attachment.service_attachment_position_id IS \'(DC2Type:uuid)\'');
  27.         $this->addSql('ALTER TABLE application_attachment ADD CONSTRAINT FK_EDCE8572DDEDEE7 FOREIGN KEY (service_attachment_position_id) REFERENCES service_attachment_position (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  28.         $this->addSql('CREATE INDEX IDX_EDCE8572DDEDEE7 ON application_attachment (service_attachment_position_id)');
  29.     }
  30.     public function down(Schema $schema): void
  31.     {
  32.         $this->addSql('ALTER TABLE application_attachment DROP CONSTRAINT FK_EDCE8572DDEDEE7');
  33.         $this->addSql('ALTER TABLE service_attachment_position DROP CONSTRAINT FK_83A8992F4C3A3BB');
  34.         $this->addSql('ALTER TABLE service_attachment_position DROP CONSTRAINT FK_83A8992FED5CA9E6');
  35.         $this->addSql('DROP TABLE service_attachment_position');
  36.         $this->addSql('DROP INDEX IDX_EDCE8572DDEDEE7');
  37.         $this->addSql('ALTER TABLE application_attachment DROP service_attachment_position_id');
  38.     }
  39. }