<?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 Version20220602144521 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
$this->addSql('CREATE TABLE summary_balance (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, building_id INT NOT NULL, type INT NOT NULL, option_id INT NOT NULL, sum_income DOUBLE PRECISION NOT NULL, sum_outcome DOUBLE PRECISION NOT NULL, year VARCHAR(5) NOT NULL, created_at DATETIME NOT NULL, update_at DATETIME NOT NULL, INDEX IDX_D364F1E5A76ED395 (user_id), INDEX IDX_D364F1E54D2A7E12 (building_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE summary_balance ADD CONSTRAINT FK_D364F1E5A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)');
$this->addSql('ALTER TABLE summary_balance ADD CONSTRAINT FK_D364F1E54D2A7E12 FOREIGN KEY (building_id) REFERENCES building (id)');
}
public function down(Schema $schema) : void
{
$this->addSql('DROP TABLE summary_balance');
}
}