migrations/Version20221029102649.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 Version20221029102649 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 TABLE ref_type_operation_paie (id INT AUTO_INCREMENT NOT NULL, created_by INT DEFAULT NULL, updated_by INT DEFAULT NULL, deleted_by INT DEFAULT NULL, lib VARCHAR(255) NOT NULL, lib_court VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_85B412B4DE12AB56 (created_by), INDEX IDX_85B412B416FE72E1 (updated_by), INDEX IDX_85B412B41F6FA0AF (deleted_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE tbl_operation_paie (id INT AUTO_INCREMENT NOT NULL, personnel_id INT NOT NULL, created_by INT DEFAULT NULL, updated_by INT DEFAULT NULL, deleted_by INT DEFAULT NULL, date VARCHAR(255) NOT NULL, montant DOUBLE PRECISION NOT NULL, description VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_32328DD21C109075 (personnel_id), INDEX IDX_32328DD2DE12AB56 (created_by), INDEX IDX_32328DD216FE72E1 (updated_by), INDEX IDX_32328DD21F6FA0AF (deleted_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('ALTER TABLE ref_type_operation_paie ADD CONSTRAINT FK_85B412B4DE12AB56 FOREIGN KEY (created_by) REFERENCES user (user_id)');
  21.         $this->addSql('ALTER TABLE ref_type_operation_paie ADD CONSTRAINT FK_85B412B416FE72E1 FOREIGN KEY (updated_by) REFERENCES user (user_id)');
  22.         $this->addSql('ALTER TABLE ref_type_operation_paie ADD CONSTRAINT FK_85B412B41F6FA0AF FOREIGN KEY (deleted_by) REFERENCES user (user_id)');
  23.         $this->addSql('ALTER TABLE tbl_operation_paie ADD CONSTRAINT FK_32328DD21C109075 FOREIGN KEY (personnel_id) REFERENCES tbl_personnel (id)');
  24.         $this->addSql('ALTER TABLE tbl_operation_paie ADD CONSTRAINT FK_32328DD2DE12AB56 FOREIGN KEY (created_by) REFERENCES user (user_id)');
  25.         $this->addSql('ALTER TABLE tbl_operation_paie ADD CONSTRAINT FK_32328DD216FE72E1 FOREIGN KEY (updated_by) REFERENCES user (user_id)');
  26.         $this->addSql('ALTER TABLE tbl_operation_paie ADD CONSTRAINT FK_32328DD21F6FA0AF FOREIGN KEY (deleted_by) REFERENCES user (user_id)');
  27.     }
  28.     public function down(Schema $schema): void
  29.     {
  30.         // this down() migration is auto-generated, please modify it to your needs
  31.         $this->addSql('ALTER TABLE ref_type_operation_paie DROP FOREIGN KEY FK_85B412B4DE12AB56');
  32.         $this->addSql('ALTER TABLE ref_type_operation_paie DROP FOREIGN KEY FK_85B412B416FE72E1');
  33.         $this->addSql('ALTER TABLE ref_type_operation_paie DROP FOREIGN KEY FK_85B412B41F6FA0AF');
  34.         $this->addSql('ALTER TABLE tbl_operation_paie DROP FOREIGN KEY FK_32328DD21C109075');
  35.         $this->addSql('ALTER TABLE tbl_operation_paie DROP FOREIGN KEY FK_32328DD2DE12AB56');
  36.         $this->addSql('ALTER TABLE tbl_operation_paie DROP FOREIGN KEY FK_32328DD216FE72E1');
  37.         $this->addSql('ALTER TABLE tbl_operation_paie DROP FOREIGN KEY FK_32328DD21F6FA0AF');
  38.         $this->addSql('DROP TABLE ref_type_operation_paie');
  39.         $this->addSql('DROP TABLE tbl_operation_paie');
  40.     }
  41. }