<?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 Version20221029102649 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 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');
$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');
$this->addSql('ALTER TABLE ref_type_operation_paie ADD CONSTRAINT FK_85B412B4DE12AB56 FOREIGN KEY (created_by) REFERENCES user (user_id)');
$this->addSql('ALTER TABLE ref_type_operation_paie ADD CONSTRAINT FK_85B412B416FE72E1 FOREIGN KEY (updated_by) REFERENCES user (user_id)');
$this->addSql('ALTER TABLE ref_type_operation_paie ADD CONSTRAINT FK_85B412B41F6FA0AF FOREIGN KEY (deleted_by) REFERENCES user (user_id)');
$this->addSql('ALTER TABLE tbl_operation_paie ADD CONSTRAINT FK_32328DD21C109075 FOREIGN KEY (personnel_id) REFERENCES tbl_personnel (id)');
$this->addSql('ALTER TABLE tbl_operation_paie ADD CONSTRAINT FK_32328DD2DE12AB56 FOREIGN KEY (created_by) REFERENCES user (user_id)');
$this->addSql('ALTER TABLE tbl_operation_paie ADD CONSTRAINT FK_32328DD216FE72E1 FOREIGN KEY (updated_by) REFERENCES user (user_id)');
$this->addSql('ALTER TABLE tbl_operation_paie ADD CONSTRAINT FK_32328DD21F6FA0AF FOREIGN KEY (deleted_by) REFERENCES user (user_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE ref_type_operation_paie DROP FOREIGN KEY FK_85B412B4DE12AB56');
$this->addSql('ALTER TABLE ref_type_operation_paie DROP FOREIGN KEY FK_85B412B416FE72E1');
$this->addSql('ALTER TABLE ref_type_operation_paie DROP FOREIGN KEY FK_85B412B41F6FA0AF');
$this->addSql('ALTER TABLE tbl_operation_paie DROP FOREIGN KEY FK_32328DD21C109075');
$this->addSql('ALTER TABLE tbl_operation_paie DROP FOREIGN KEY FK_32328DD2DE12AB56');
$this->addSql('ALTER TABLE tbl_operation_paie DROP FOREIGN KEY FK_32328DD216FE72E1');
$this->addSql('ALTER TABLE tbl_operation_paie DROP FOREIGN KEY FK_32328DD21F6FA0AF');
$this->addSql('DROP TABLE ref_type_operation_paie');
$this->addSql('DROP TABLE tbl_operation_paie');
}
}