<?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 Version20230829165513 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 refill (id INT NOT NULL, project_id INT NOT NULL, value DOUBLE PRECISION NOT NULL DEFAULT 0, date_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_72FDA4FC166D1F9C ON refill (project_id)');
$this->addSql('ALTER TABLE refill ADD CONSTRAINT FK_72FDA4FC166D1F9C FOREIGN KEY (project_id) REFERENCES project (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE refill DROP CONSTRAINT FK_72FDA4FC166D1F9C');
$this->addSql('DROP TABLE refill');
$this->addSql('DROP INDEX UNIQ_5D9F75A15E237E06');
}
}