<?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 Version20231110120615 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 interest_paidoff_report (id INT AUTO_INCREMENT NOT NULL, company_id INT NOT NULL, product_id INT NOT NULL, created_by_id INT NOT NULL, date_from DATE NOT NULL, date_to DATE NOT NULL, total_revenues DOUBLE PRECISION NOT NULL, total_tax DOUBLE PRECISION NOT NULL, created DATETIME NOT NULL, INDEX IDX_65220A7B979B1AD6 (company_id), INDEX IDX_65220A7B4584665A (product_id), INDEX IDX_65220A7BB03A8386 (created_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE interest_paidoff_report ADD CONSTRAINT FK_65220A7B979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE interest_paidoff_report ADD CONSTRAINT FK_65220A7B4584665A FOREIGN KEY (product_id) REFERENCES product (id)');
$this->addSql('ALTER TABLE interest_paidoff_report ADD CONSTRAINT FK_65220A7BB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE interest_paidoff ADD interest_paidoff_report_id INT NOT NULL, ADD order_number VARCHAR(255) NOT NULL, ADD order_full_name VARCHAR(255) NOT NULL, ADD order_birthdate VARCHAR(255) DEFAULT NULL, ADD new_business TINYINT(1) NOT NULL, ADD bank_account VARCHAR(255) NOT NULL, ADD paid_datetime DATETIME DEFAULT NULL, ADD deleted TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE interest_paidoff ADD CONSTRAINT FK_494D555D116AEB8A FOREIGN KEY (interest_paidoff_report_id) REFERENCES interest_paidoff_report (id)');
$this->addSql('CREATE INDEX IDX_494D555D116AEB8A ON interest_paidoff (interest_paidoff_report_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE interest_paidoff DROP FOREIGN KEY FK_494D555D116AEB8A');
$this->addSql('ALTER TABLE interest_paidoff_report DROP FOREIGN KEY FK_65220A7B979B1AD6');
$this->addSql('ALTER TABLE interest_paidoff_report DROP FOREIGN KEY FK_65220A7B4584665A');
$this->addSql('ALTER TABLE interest_paidoff_report DROP FOREIGN KEY FK_65220A7BB03A8386');
$this->addSql('DROP TABLE interest_paidoff_report');
$this->addSql('DROP INDEX IDX_494D555D116AEB8A ON interest_paidoff');
$this->addSql('ALTER TABLE interest_paidoff DROP interest_paidoff_report_id, DROP order_number, DROP order_full_name, DROP order_birthdate, DROP new_business, DROP bank_account, DROP paid_datetime, DROP deleted');
}
}