<?php
declare(strict_types=1);
namespace RecurringInvoicesBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20231123225208 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice ADD invoice_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice ADD CONSTRAINT FK_6B9712E1E7D55D4 FOREIGN KEY (invoice_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice ADD CONSTRAINT FK_6B9712EF9E4B26E FOREIGN KEY (delivery_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('CREATE INDEX IDX_6B9712E1E7D55D4 ON recurring_invoices_bundle__recurring_invoice (invoice_contact_id)');
$this->addSql('CREATE INDEX IDX_6B9712EF9E4B26E ON recurring_invoices_bundle__recurring_invoice (delivery_contact_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice DROP FOREIGN KEY FK_6B9712E1E7D55D4');
$this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice DROP FOREIGN KEY FK_6B9712EF9E4B26E');
$this->addSql('DROP INDEX IDX_6B9712E1E7D55D4 ON recurring_invoices_bundle__recurring_invoice');
$this->addSql('DROP INDEX IDX_6B9712EF9E4B26E ON recurring_invoices_bundle__recurring_invoice');
$this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice DROP invoice_contact_id, DROP delivery_contact_id');
}
}