<?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 Version20250925153623 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 rh_staff_status (id VARCHAR(64) NOT NULL, user_create_id INT DEFAULT NULL, user_update_id INT DEFAULT NULL, label VARCHAR(512) NOT NULL, is_deleted TINYINT(1) NOT NULL, date_create DATETIME DEFAULT NULL, date_update DATETIME DEFAULT NULL, is_actif TINYINT(1) DEFAULT NULL, INDEX IDX_EDDF0A49EEFE5067 (user_create_id), INDEX IDX_EDDF0A49D5766755 (user_update_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE rh_staff_status ADD CONSTRAINT FK_EDDF0A49EEFE5067 FOREIGN KEY (user_create_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE rh_staff_status ADD CONSTRAINT FK_EDDF0A49D5766755 FOREIGN KEY (user_update_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE rh_staff ADD staff_status_id VARCHAR(64) DEFAULT NULL');
$this->addSql('ALTER TABLE rh_staff ADD CONSTRAINT FK_4A9AF5AB5ABBD0F2 FOREIGN KEY (staff_status_id) REFERENCES rh_staff_status (id)');
$this->addSql('CREATE INDEX IDX_4A9AF5AB5ABBD0F2 ON rh_staff (staff_status_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE rh_staff DROP FOREIGN KEY FK_4A9AF5AB5ABBD0F2');
$this->addSql('ALTER TABLE rh_staff_status DROP FOREIGN KEY FK_EDDF0A49EEFE5067');
$this->addSql('ALTER TABLE rh_staff_status DROP FOREIGN KEY FK_EDDF0A49D5766755');
$this->addSql('DROP TABLE rh_staff_status');
$this->addSql('DROP INDEX IDX_4A9AF5AB5ABBD0F2 ON rh_staff');
$this->addSql('ALTER TABLE rh_staff DROP staff_status_id');
}
}