<?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 Version20220717105834 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 request_service (id INT AUTO_INCREMENT NOT NULL, client_id INT DEFAULT NULL, adviser_id INT DEFAULT NULL, service VARCHAR(255) NOT NULL, date VARCHAR(255) NOT NULL, message LONGTEXT DEFAULT NULL, created_at DATETIME DEFAULT NULL, modified_at DATETIME DEFAULT NULL, created_user INT DEFAULT NULL, modified_user INT DEFAULT NULL, INDEX IDX_CBB9E88519EB6921 (client_id), INDEX IDX_CBB9E8852C63B5D6 (adviser_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE request_spare_part (id INT AUTO_INCREMENT NOT NULL, client_id INT DEFAULT NULL, adviser_id INT DEFAULT NULL, spare_parts LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', created_at DATETIME DEFAULT NULL, modified_at DATETIME DEFAULT NULL, created_user INT DEFAULT NULL, modified_user INT DEFAULT NULL, INDEX IDX_AB295A8C19EB6921 (client_id), INDEX IDX_AB295A8C2C63B5D6 (adviser_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE request_service ADD CONSTRAINT FK_CBB9E88519EB6921 FOREIGN KEY (client_id) REFERENCES user_client (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE request_service ADD CONSTRAINT FK_CBB9E8852C63B5D6 FOREIGN KEY (adviser_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE request_spare_part ADD CONSTRAINT FK_AB295A8C19EB6921 FOREIGN KEY (client_id) REFERENCES user_client (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE request_spare_part ADD CONSTRAINT FK_AB295A8C2C63B5D6 FOREIGN KEY (adviser_id) REFERENCES user (id) ON DELETE SET NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE request_service');
$this->addSql('DROP TABLE request_spare_part');
}
}