<?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 Version20220205234547 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 fiche (id INT AUTO_INCREMENT NOT NULL, employe_id INT DEFAULT NULL, respnsable_id INT DEFAULT NULL, groupe_id INT DEFAULT NULL, etat_avancement INT DEFAULT NULL, etat_validation INT DEFAULT NULL, validated_by INT DEFAULT NULL, date_last_modify DATETIME DEFAULT NULL, validated_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, created_by INT DEFAULT NULL, updated_by INT DEFAULT NULL, INDEX IDX_4C13CC781B65292 (employe_id), INDEX IDX_4C13CC78E31D8125 (respnsable_id), INDEX IDX_4C13CC787A45358C (groupe_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE task_job (id INT AUTO_INCREMENT NOT NULL, type_activity_id INT DEFAULT NULL, user_id INT DEFAULT NULL, fiche_id INT DEFAULT NULL, nombre_activity INT DEFAULT NULL, temps_passer VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, created_by INT DEFAULT NULL, updated_by INT DEFAULT NULL, INDEX IDX_945A187FCAD9B707 (type_activity_id), INDEX IDX_945A187FA76ED395 (user_id), INDEX IDX_945A187FDF522508 (fiche_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE fiche ADD CONSTRAINT FK_4C13CC781B65292 FOREIGN KEY (employe_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE fiche ADD CONSTRAINT FK_4C13CC78E31D8125 FOREIGN KEY (respnsable_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE fiche ADD CONSTRAINT FK_4C13CC787A45358C FOREIGN KEY (groupe_id) REFERENCES groupe (id)');
$this->addSql('ALTER TABLE task_job ADD CONSTRAINT FK_945A187FCAD9B707 FOREIGN KEY (type_activity_id) REFERENCES activity (id)');
$this->addSql('ALTER TABLE task_job ADD CONSTRAINT FK_945A187FA76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE task_job ADD CONSTRAINT FK_945A187FDF522508 FOREIGN KEY (fiche_id) REFERENCES fiche (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE task_job DROP FOREIGN KEY FK_945A187FDF522508');
$this->addSql('DROP TABLE fiche');
$this->addSql('DROP TABLE task_job');
}
}