<?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 Version20251202111141 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 SEQUENCE objectif_financiere_annuel_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE objectif_financiere_annuel (id INT NOT NULL, coordination_zone_id INT DEFAULT NULL, periode_realisation_id INT DEFAULT NULL, sous_composante_id INT DEFAULT NULL, realisation_physique_ptba NUMERIC(10, 2) DEFAULT NULL, taux_engagement_fin_ptba NUMERIC(10, 2) DEFAULT NULL, realisation_financiere_ptba NUMERIC(10, 2) DEFAULT NULL, realisation_financiere_cumule NUMERIC(10, 2) DEFAULT NULL, realisation_physique_cumule NUMERIC(10, 2) DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_25AA0E2D7D964498 ON objectif_financiere_annuel (coordination_zone_id)');
$this->addSql('CREATE INDEX IDX_25AA0E2DF2A878AD ON objectif_financiere_annuel (periode_realisation_id)');
$this->addSql('CREATE INDEX IDX_25AA0E2D9175F422 ON objectif_financiere_annuel (sous_composante_id)');
$this->addSql('COMMENT ON COLUMN objectif_financiere_annuel.created_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN objectif_financiere_annuel.updated_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('ALTER TABLE objectif_financiere_annuel ADD CONSTRAINT FK_25AA0E2D7D964498 FOREIGN KEY (coordination_zone_id) REFERENCES coordination_zone (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE objectif_financiere_annuel ADD CONSTRAINT FK_25AA0E2DF2A878AD FOREIGN KEY (periode_realisation_id) REFERENCES periode_realisation (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE objectif_financiere_annuel ADD CONSTRAINT FK_25AA0E2D9175F422 FOREIGN KEY (sous_composante_id) REFERENCES sous_composante (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('CREATE SCHEMA public');
$this->addSql('DROP SEQUENCE objectif_financiere_annuel_id_seq CASCADE');
$this->addSql('ALTER TABLE objectif_financiere_annuel DROP CONSTRAINT FK_25AA0E2D7D964498');
$this->addSql('ALTER TABLE objectif_financiere_annuel DROP CONSTRAINT FK_25AA0E2DF2A878AD');
$this->addSql('ALTER TABLE objectif_financiere_annuel DROP CONSTRAINT FK_25AA0E2D9175F422');
$this->addSql('DROP TABLE objectif_financiere_annuel');
}
}