<?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 Version20250623081250 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('CREATE TABLE shipment_confirmation (id UUID NOT NULL, shipment_id UUID NOT NULL, confirmed_by_id UUID NOT NULL, created_by UUID DEFAULT NULL, updated_by UUID DEFAULT NULL, notes TEXT DEFAULT 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))');
$this->addSql('CREATE INDEX IDX_BF707BF97BE036FC ON shipment_confirmation (shipment_id)');
$this->addSql('CREATE INDEX IDX_BF707BF96F45385D ON shipment_confirmation (confirmed_by_id)');
$this->addSql('CREATE INDEX IDX_BF707BF9DE12AB56 ON shipment_confirmation (created_by)');
$this->addSql('CREATE INDEX IDX_BF707BF916FE72E1 ON shipment_confirmation (updated_by)');
$this->addSql('COMMENT ON COLUMN shipment_confirmation.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN shipment_confirmation.shipment_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN shipment_confirmation.confirmed_by_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN shipment_confirmation.created_by IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN shipment_confirmation.updated_by IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE shipment_confirmation ADD CONSTRAINT FK_BF707BF97BE036FC FOREIGN KEY (shipment_id) REFERENCES shipment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE shipment_confirmation ADD CONSTRAINT FK_BF707BF96F45385D FOREIGN KEY (confirmed_by_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE shipment_confirmation ADD CONSTRAINT FK_BF707BF9DE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE shipment_confirmation ADD CONSTRAINT FK_BF707BF916FE72E1 FOREIGN KEY (updated_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE shipment_confirmation DROP CONSTRAINT FK_BF707BF97BE036FC');
$this->addSql('ALTER TABLE shipment_confirmation DROP CONSTRAINT FK_BF707BF96F45385D');
$this->addSql('ALTER TABLE shipment_confirmation DROP CONSTRAINT FK_BF707BF9DE12AB56');
$this->addSql('ALTER TABLE shipment_confirmation DROP CONSTRAINT FK_BF707BF916FE72E1');
$this->addSql('DROP TABLE shipment_confirmation');
}
}