<?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 Version20210813095444 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 cal_maintenance_document (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(100) NOT NULL, private TINYINT(1) DEFAULT NULL, created_at DATETIME DEFAULT NULL, docusign_envelope_id VARCHAR(255) DEFAULT NULL, status VARCHAR(50) DEFAULT NULL, type VARCHAR(50) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE cal_maintenance_quotation (id INT AUTO_INCREMENT NOT NULL, maintenance_id INT DEFAULT NULL, assignement_id INT DEFAULT NULL, document_id INT DEFAULT NULL, status VARCHAR(50) NOT NULL, price INT NOT NULL, comment LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, INDEX IDX_7568E689F6C202BC (maintenance_id), INDEX IDX_7568E689698C4682 (assignement_id), UNIQUE INDEX UNIQ_7568E689C33F7837 (document_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE cal_maintenance_quotation ADD CONSTRAINT FK_7568E689F6C202BC FOREIGN KEY (maintenance_id) REFERENCES cal_maintenance (id)');
$this->addSql('ALTER TABLE cal_maintenance_quotation ADD CONSTRAINT FK_7568E689698C4682 FOREIGN KEY (assignement_id) REFERENCES cal_maintenance_assignment (id)');
$this->addSql('ALTER TABLE cal_maintenance_quotation ADD CONSTRAINT FK_7568E689C33F7837 FOREIGN KEY (document_id) REFERENCES cal_maintenance_document (id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cal_maintenance_quotation DROP FOREIGN KEY FK_7568E689C33F7837');
$this->addSql('DROP TABLE cal_maintenance_document');
$this->addSql('DROP TABLE cal_maintenance_quotation');
}
}