migrations/Version20221109101044.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 Version20221109101044 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 tbl_paie_salaire (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, mois_paiement DATE NOT NULL, montant_salaire 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_21311CA11C109075 (personnel_id), INDEX IDX_21311CA1DE12AB56 (created_by), INDEX IDX_21311CA116FE72E1 (updated_by), INDEX IDX_21311CA11F6FA0AF (deleted_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE tbl_paie_salaire ADD CONSTRAINT FK_21311CA11C109075 FOREIGN KEY (personnel_id) REFERENCES tbl_personnel (id)');
  20.         $this->addSql('ALTER TABLE tbl_paie_salaire ADD CONSTRAINT FK_21311CA1DE12AB56 FOREIGN KEY (created_by) REFERENCES user (user_id)');
  21.         $this->addSql('ALTER TABLE tbl_paie_salaire ADD CONSTRAINT FK_21311CA116FE72E1 FOREIGN KEY (updated_by) REFERENCES user (user_id)');
  22.         $this->addSql('ALTER TABLE tbl_paie_salaire ADD CONSTRAINT FK_21311CA11F6FA0AF FOREIGN KEY (deleted_by) REFERENCES user (user_id)');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('ALTER TABLE tbl_paie_salaire DROP FOREIGN KEY FK_21311CA11C109075');
  28.         $this->addSql('ALTER TABLE tbl_paie_salaire DROP FOREIGN KEY FK_21311CA1DE12AB56');
  29.         $this->addSql('ALTER TABLE tbl_paie_salaire DROP FOREIGN KEY FK_21311CA116FE72E1');
  30.         $this->addSql('ALTER TABLE tbl_paie_salaire DROP FOREIGN KEY FK_21311CA11F6FA0AF');
  31.         $this->addSql('DROP TABLE tbl_paie_salaire');
  32.     }
  33. }