Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
- Nouvelle entité InterimAgency (table interim_agencies, API lecture seule) - Sélecteur agence conditionnel dans les formulaires création employé et ajout contrat - Affichage "Intérim (NomAgence)" sur la liste employés et l'historique contrat - Date de fin obligatoire côté frontend pour CDD et INTERIM (aligné backend) - Renommage "Types d'absence" → "Types de statut" (sidebar, page, titre) - Renommage en-tête "Absence" → "Statut" sur les vues jour heures et conducteurs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33 lines
1.3 KiB
PHP
33 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
final class Version20260417120000 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Create interim_agencies table and add interim_agency_id to employee_contract_periods';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql('CREATE TABLE interim_agencies (id SERIAL PRIMARY KEY, name VARCHAR(150) NOT NULL UNIQUE)');
|
|
$this->addSql('ALTER TABLE employee_contract_periods ADD interim_agency_id INT DEFAULT NULL');
|
|
$this->addSql('ALTER TABLE employee_contract_periods ADD CONSTRAINT fk_ecp_interim_agency FOREIGN KEY (interim_agency_id) REFERENCES interim_agencies (id) ON DELETE SET NULL');
|
|
$this->addSql('CREATE INDEX idx_ecp_interim_agency ON employee_contract_periods (interim_agency_id)');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE employee_contract_periods DROP CONSTRAINT IF EXISTS fk_ecp_interim_agency');
|
|
$this->addSql('DROP INDEX IF EXISTS idx_ecp_interim_agency');
|
|
$this->addSql('ALTER TABLE employee_contract_periods DROP COLUMN interim_agency_id');
|
|
$this->addSql('DROP TABLE interim_agencies');
|
|
}
|
|
}
|