<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221019094140 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 gocardless_bundle__customer_mapping (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', customer_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', reference VARCHAR(32) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_7D092DE99395C3F3 (customer_id), INDEX IDX_7D092DE9B03A8386 (created_by_id), INDEX IDX_7D092DE9896DBBDE (updated_by_id), INDEX IDX_7D092DE9C76F1F52 (deleted_by_id), INDEX reference (reference), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE gocardless_bundle__direct_debit (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', customer_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', invoice_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', document_payment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', mandate_reference VARCHAR(255) NOT NULL, payment_number VARCHAR(255) NOT NULL, state VARCHAR(255) NOT NULL, payment_date DATE NOT NULL, amount NUMERIC(20, 6) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_59F696BA9395C3F3 (customer_id), INDEX IDX_59F696BA2989F1FD (invoice_id), UNIQUE INDEX UNIQ_59F696BAA50008ED (document_payment_id), INDEX IDX_59F696BAB03A8386 (created_by_id), INDEX IDX_59F696BA896DBBDE (updated_by_id), INDEX IDX_59F696BAC76F1F52 (deleted_by_id), INDEX mandate_reference (mandate_reference), INDEX payment_number (payment_number), INDEX state (state), INDEX payment_date (payment_date), INDEX amount (amount), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE gocardless_bundle__payout (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', currency_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', reference VARCHAR(255) NOT NULL, creditor VARCHAR(255) NOT NULL, date DATE NOT NULL, amount NUMERIC(20, 6) NOT NULL, commission NUMERIC(20, 6) NOT NULL, net_amount NUMERIC(20, 6) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_9DEBA9C938248176 (currency_id), INDEX IDX_9DEBA9C9B03A8386 (created_by_id), INDEX IDX_9DEBA9C9896DBBDE (updated_by_id), INDEX IDX_9DEBA9C9C76F1F52 (deleted_by_id), INDEX reference (reference), INDEX creditor (creditor), INDEX date (date), INDEX amount (amount), INDEX commission (commission), INDEX net_amount (net_amount), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE gocardless_bundle__payout_detail (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', payout_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', direct_debit_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', amount VARCHAR(255) NOT NULL, commission VARCHAR(255) NOT NULL, net_amount VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_A08DCDD9C6D61B7F (payout_id), INDEX IDX_A08DCDD9ED508722 (direct_debit_id), INDEX IDX_A08DCDD9B03A8386 (created_by_id), INDEX IDX_A08DCDD9896DBBDE (updated_by_id), INDEX IDX_A08DCDD9C76F1F52 (deleted_by_id), INDEX amount (amount), INDEX commission (commission), INDEX net_amount (net_amount), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE gocardless_bundle__customer_mapping ADD CONSTRAINT FK_7D092DE99395C3F3 FOREIGN KEY (customer_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('ALTER TABLE gocardless_bundle__customer_mapping ADD CONSTRAINT FK_7D092DE9B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__customer_mapping ADD CONSTRAINT FK_7D092DE9896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__customer_mapping ADD CONSTRAINT FK_7D092DE9C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__direct_debit ADD CONSTRAINT FK_59F696BA9395C3F3 FOREIGN KEY (customer_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('ALTER TABLE gocardless_bundle__direct_debit ADD CONSTRAINT FK_59F696BA2989F1FD FOREIGN KEY (invoice_id) REFERENCES sales_bundle__invoice (id)');
$this->addSql('ALTER TABLE gocardless_bundle__direct_debit ADD CONSTRAINT FK_59F696BAA50008ED FOREIGN KEY (document_payment_id) REFERENCES sales_bundle__document_payment (id)');
$this->addSql('ALTER TABLE gocardless_bundle__direct_debit ADD CONSTRAINT FK_59F696BAB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__direct_debit ADD CONSTRAINT FK_59F696BA896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__direct_debit ADD CONSTRAINT FK_59F696BAC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__payout ADD CONSTRAINT FK_9DEBA9C938248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
$this->addSql('ALTER TABLE gocardless_bundle__payout ADD CONSTRAINT FK_9DEBA9C9B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__payout ADD CONSTRAINT FK_9DEBA9C9896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__payout ADD CONSTRAINT FK_9DEBA9C9C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__payout_detail ADD CONSTRAINT FK_A08DCDD9C6D61B7F FOREIGN KEY (payout_id) REFERENCES gocardless_bundle__payout (id)');
$this->addSql('ALTER TABLE gocardless_bundle__payout_detail ADD CONSTRAINT FK_A08DCDD9ED508722 FOREIGN KEY (direct_debit_id) REFERENCES gocardless_bundle__direct_debit (id)');
$this->addSql('ALTER TABLE gocardless_bundle__payout_detail ADD CONSTRAINT FK_A08DCDD9B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__payout_detail ADD CONSTRAINT FK_A08DCDD9896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE gocardless_bundle__payout_detail ADD CONSTRAINT FK_A08DCDD9C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE gocardless_bundle__payout_detail DROP FOREIGN KEY FK_A08DCDD9ED508722');
$this->addSql('ALTER TABLE gocardless_bundle__payout_detail DROP FOREIGN KEY FK_A08DCDD9C6D61B7F');
$this->addSql('DROP TABLE gocardless_bundle__customer_mapping');
$this->addSql('DROP TABLE gocardless_bundle__direct_debit');
$this->addSql('DROP TABLE gocardless_bundle__payout');
$this->addSql('DROP TABLE gocardless_bundle__payout_detail');
}
}