migrations/Version20251202111141.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20251202111141 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE SEQUENCE objectif_financiere_annuel_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  19.         $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))');
  20.         $this->addSql('CREATE INDEX IDX_25AA0E2D7D964498 ON objectif_financiere_annuel (coordination_zone_id)');
  21.         $this->addSql('CREATE INDEX IDX_25AA0E2DF2A878AD ON objectif_financiere_annuel (periode_realisation_id)');
  22.         $this->addSql('CREATE INDEX IDX_25AA0E2D9175F422 ON objectif_financiere_annuel (sous_composante_id)');
  23.         $this->addSql('COMMENT ON COLUMN objectif_financiere_annuel.created_at IS \'(DC2Type:datetime_immutable)\'');
  24.         $this->addSql('COMMENT ON COLUMN objectif_financiere_annuel.updated_at IS \'(DC2Type:datetime_immutable)\'');
  25.         $this->addSql('ALTER TABLE objectif_financiere_annuel ADD CONSTRAINT FK_25AA0E2D7D964498 FOREIGN KEY (coordination_zone_id) REFERENCES coordination_zone (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  26.         $this->addSql('ALTER TABLE objectif_financiere_annuel ADD CONSTRAINT FK_25AA0E2DF2A878AD FOREIGN KEY (periode_realisation_id) REFERENCES periode_realisation (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  27.         $this->addSql('ALTER TABLE objectif_financiere_annuel ADD CONSTRAINT FK_25AA0E2D9175F422 FOREIGN KEY (sous_composante_id) REFERENCES sous_composante (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->addSql('CREATE SCHEMA public');
  33.         $this->addSql('DROP SEQUENCE objectif_financiere_annuel_id_seq CASCADE');
  34.         $this->addSql('ALTER TABLE objectif_financiere_annuel DROP CONSTRAINT FK_25AA0E2D7D964498');
  35.         $this->addSql('ALTER TABLE objectif_financiere_annuel DROP CONSTRAINT FK_25AA0E2DF2A878AD');
  36.         $this->addSql('ALTER TABLE objectif_financiere_annuel DROP CONSTRAINT FK_25AA0E2D9175F422');
  37.         $this->addSql('DROP TABLE objectif_financiere_annuel');
  38.     }
  39. }