<?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 Version20221128125815 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 utility_bills_bundle__utility_bill (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', supplier_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)\', commentary LONGTEXT DEFAULT NULL, reference VARCHAR(255) DEFAULT NULL, date DATETIME NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_8A464C6C2ADD6D8C (supplier_id), INDEX IDX_8A464C6C38248176 (currency_id), INDEX IDX_8A464C6CB03A8386 (created_by_id), INDEX IDX_8A464C6C896DBBDE (updated_by_id), INDEX IDX_8A464C6CC76F1F52 (deleted_by_id), INDEX reference (reference), INDEX date (date), 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 utility_bills_bundle__utility_bill_line (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', utility_bill_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', tax_rule_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)\', account_number VARCHAR(255) DEFAULT NULL, price_untaxed NUMERIC(20, 6) NOT NULL, price NUMERIC(20, 6) NOT NULL, tax_amount NUMERIC(20, 6) NOT NULL, name VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_B44A389736287E91 (utility_bill_id), INDEX IDX_B44A38973506A35B (tax_rule_id), INDEX IDX_B44A3897B03A8386 (created_by_id), INDEX IDX_B44A3897896DBBDE (updated_by_id), INDEX IDX_B44A3897C76F1F52 (deleted_by_id), 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 utility_bills_bundle__utility_bill ADD CONSTRAINT FK_8A464C6C2ADD6D8C FOREIGN KEY (supplier_id) REFERENCES suppliers_bundle__supplier (id)');
$this->addSql('ALTER TABLE utility_bills_bundle__utility_bill ADD CONSTRAINT FK_8A464C6C38248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
$this->addSql('ALTER TABLE utility_bills_bundle__utility_bill ADD CONSTRAINT FK_8A464C6CB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE utility_bills_bundle__utility_bill ADD CONSTRAINT FK_8A464C6C896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE utility_bills_bundle__utility_bill ADD CONSTRAINT FK_8A464C6CC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE utility_bills_bundle__utility_bill_line ADD CONSTRAINT FK_B44A389736287E91 FOREIGN KEY (utility_bill_id) REFERENCES utility_bills_bundle__utility_bill (id)');
$this->addSql('ALTER TABLE utility_bills_bundle__utility_bill_line ADD CONSTRAINT FK_B44A38973506A35B FOREIGN KEY (tax_rule_id) REFERENCES tax_rule (id)');
$this->addSql('ALTER TABLE utility_bills_bundle__utility_bill_line ADD CONSTRAINT FK_B44A3897B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE utility_bills_bundle__utility_bill_line ADD CONSTRAINT FK_B44A3897896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE utility_bills_bundle__utility_bill_line ADD CONSTRAINT FK_B44A3897C76F1F52 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 utility_bills_bundle__utility_bill_line DROP FOREIGN KEY FK_B44A389736287E91');
$this->addSql('DROP TABLE utility_bills_bundle__utility_bill');
$this->addSql('DROP TABLE utility_bills_bundle__utility_bill_line');
}
}