Files
SIRH/migrations/Version20260217161000.php
tristan ee16779777
All checks were successful
Auto Tag Develop / tag (push) Successful in 5s
[#322] Page horaire (#4)
| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|        #322          |        Page horaire         |

## Description de la PR
[#322] Page horaire

## Modification du .env

## Check list

- [ ] Pas de régression
- [ ] TU/TI/TF rédigée
- [ ] TU/TI/TF OK
- [ ] CHANGELOG modifié

Reviewed-on: #4
Co-authored-by: tristan <tristan@yuno.malio.fr>
Co-committed-by: tristan <tristan@yuno.malio.fr>
2026-02-20 11:23:52 +00:00

35 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260217161000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add contract_hours and is_forfait to employees';
}
public function up(Schema $schema): void
{
// Nettoie l'ancien modele "contracts" s'il a deja ete applique.
$this->addSql('ALTER TABLE employees DROP CONSTRAINT IF EXISTS FK_EMPLOYEES_CONTRACT');
$this->addSql('DROP INDEX IF EXISTS IDX_EMPLOYEES_CONTRACT');
$this->addSql('ALTER TABLE employees DROP COLUMN IF EXISTS contract_id');
$this->addSql('DROP TABLE IF EXISTS contracts');
$this->addSql('ALTER TABLE employees ADD COLUMN IF NOT EXISTS contract_hours INT DEFAULT NULL');
$this->addSql('ALTER TABLE employees ADD COLUMN IF NOT EXISTS is_forfait BOOLEAN DEFAULT FALSE NOT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE employees DROP COLUMN IF EXISTS contract_hours');
$this->addSql('ALTER TABLE employees DROP COLUMN IF EXISTS is_forfait');
}
}