feat : first commit

This commit is contained in:
2026-02-03 18:04:06 +01:00
parent 43b0364a5a
commit a5dcd5e3e9
101 changed files with 29976 additions and 96 deletions

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260202224500 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create absences table';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE absences (id SERIAL NOT NULL, employee_id INT NOT NULL, type_id INT NOT NULL, date DATE NOT NULL, comment TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_ABSENCES_EMPLOYEE ON absences (employee_id)');
$this->addSql('CREATE INDEX IDX_ABSENCES_TYPE ON absences (type_id)');
$this->addSql('ALTER TABLE absences ADD CONSTRAINT FK_ABSENCES_EMPLOYEE FOREIGN KEY (employee_id) REFERENCES employees (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE absences ADD CONSTRAINT FK_ABSENCES_TYPE FOREIGN KEY (type_id) REFERENCES absence_types (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE absences DROP CONSTRAINT FK_ABSENCES_EMPLOYEE');
$this->addSql('ALTER TABLE absences DROP CONSTRAINT FK_ABSENCES_TYPE');
$this->addSql('DROP TABLE absences');
}
}