<?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 Version20250128165120 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$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))');
$this->addSql('CREATE INDEX IDX_83A8992F4C3A3BB ON service_attachment_position (payment_id)');
$this->addSql('CREATE INDEX IDX_83A8992FED5CA9E6 ON service_attachment_position (service_id)');
$this->addSql('COMMENT ON COLUMN service_attachment_position.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN service_attachment_position.payment_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN service_attachment_position.service_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE service_attachment_position ADD CONSTRAINT FK_83A8992F4C3A3BB FOREIGN KEY (payment_id) REFERENCES abap_payment_position (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE service_attachment_position ADD CONSTRAINT FK_83A8992FED5CA9E6 FOREIGN KEY (service_id) REFERENCES service (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE application_attachment ADD service_attachment_position_id UUID DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN application_attachment.service_attachment_position_id IS \'(DC2Type:uuid)\'');
$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');
$this->addSql('CREATE INDEX IDX_EDCE8572DDEDEE7 ON application_attachment (service_attachment_position_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE application_attachment DROP CONSTRAINT FK_EDCE8572DDEDEE7');
$this->addSql('ALTER TABLE service_attachment_position DROP CONSTRAINT FK_83A8992F4C3A3BB');
$this->addSql('ALTER TABLE service_attachment_position DROP CONSTRAINT FK_83A8992FED5CA9E6');
$this->addSql('DROP TABLE service_attachment_position');
$this->addSql('DROP INDEX IDX_EDCE8572DDEDEE7');
$this->addSql('ALTER TABLE application_attachment DROP service_attachment_position_id');
}
}