<?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 Version20240513225430 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 history (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, requests_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', commentaires VARCHAR(255) DEFAULT NULL, date DATETIME DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, designation VARCHAR(255) DEFAULT NULL, INDEX IDX_27BA704BA76ED395 (user_id), INDEX IDX_27BA704B418F94FA (requests_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE project (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(255) NOT NULL, start_date DATETIME NOT NULL, finish_date DATETIME NOT NULL, criteria LONGTEXT DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, published TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE requests (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', user_request_id INT DEFAULT NULL, project_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', requirement VARCHAR(255) DEFAULT NULL, ended_at DATE DEFAULT NULL, details VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, slug VARCHAR(255) DEFAULT NULL, created_at DATE DEFAULT NULL, project_name VARCHAR(255) DEFAULT NULL, profile VARCHAR(255) NOT NULL, sector_activity VARCHAR(255) DEFAULT NULL, description_reason LONGTEXT DEFAULT NULL, description_solution LONGTEXT DEFAULT NULL, project_description LONGTEXT DEFAULT NULL, logo VARCHAR(255) DEFAULT NULL, twitter_link VARCHAR(255) DEFAULT NULL, facebook_link VARCHAR(255) DEFAULT NULL, instagram_link VARCHAR(255) DEFAULT NULL, linkedin_link VARCHAR(255) DEFAULT NULL, video_link VARCHAR(255) DEFAULT NULL, document VARCHAR(255) DEFAULT NULL, INDEX IDX_7B85D651E5197E49 (user_request_id), INDEX IDX_7B85D651166D1F9C (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE require_documents (id INT AUTO_INCREMENT NOT NULL, requests_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(255) DEFAULT NULL, path VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, INDEX IDX_87266DB0418F94FA (requests_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE history ADD CONSTRAINT FK_27BA704BA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE history ADD CONSTRAINT FK_27BA704B418F94FA FOREIGN KEY (requests_id) REFERENCES requests (id)');
$this->addSql('ALTER TABLE requests ADD CONSTRAINT FK_7B85D651E5197E49 FOREIGN KEY (user_request_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE requests ADD CONSTRAINT FK_7B85D651166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)');
$this->addSql('ALTER TABLE require_documents ADD CONSTRAINT FK_87266DB0418F94FA FOREIGN KEY (requests_id) REFERENCES requests (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE history DROP FOREIGN KEY FK_27BA704BA76ED395');
$this->addSql('ALTER TABLE history DROP FOREIGN KEY FK_27BA704B418F94FA');
$this->addSql('ALTER TABLE requests DROP FOREIGN KEY FK_7B85D651E5197E49');
$this->addSql('ALTER TABLE requests DROP FOREIGN KEY FK_7B85D651166D1F9C');
$this->addSql('ALTER TABLE require_documents DROP FOREIGN KEY FK_87266DB0418F94FA');
$this->addSql('DROP TABLE history');
$this->addSql('DROP TABLE project');
$this->addSql('DROP TABLE requests');
$this->addSql('DROP TABLE require_documents');
}
}