<?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 Version20230324092514 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('ALTER TABLE contract ADD project_id INT NOT NULL, ADD currency_id INT NOT NULL, ADD seria VARCHAR(20) NOT NULL, ADD indefinite TINYINT(1) NOT NULL, ADD exchange_rate NUMERIC(10, 6) NOT NULL, DROP year_share');
$this->addSql('ALTER TABLE contract ADD CONSTRAINT FK_E98F2859166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)');
$this->addSql('ALTER TABLE contract ADD CONSTRAINT FK_E98F285938248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
$this->addSql('CREATE INDEX IDX_E98F2859166D1F9C ON contract (project_id)');
$this->addSql('CREATE INDEX IDX_E98F285938248176 ON contract (currency_id)');
$this->addSql('ALTER TABLE offer ADD CONSTRAINT FK_29D6873E82F1BAF4 FOREIGN KEY (language_id) REFERENCES language (id)');
$this->addSql('CREATE INDEX IDX_29D6873E82F1BAF4 ON offer (language_id)');
$this->addSql('ALTER TABLE task CHANGE name name LONGTEXT NOT NULL');
$this->addSql('ALTER TABLE tranche ADD billable_value NUMERIC(10, 2) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE contract DROP FOREIGN KEY FK_E98F2859166D1F9C');
$this->addSql('ALTER TABLE contract DROP FOREIGN KEY FK_E98F285938248176');
$this->addSql('DROP INDEX IDX_E98F2859166D1F9C ON contract');
$this->addSql('DROP INDEX IDX_E98F285938248176 ON contract');
$this->addSql('ALTER TABLE contract ADD year_share DATE DEFAULT NULL, DROP project_id, DROP currency_id, DROP seria, DROP indefinite, DROP exchange_rate');
$this->addSql('ALTER TABLE offer DROP FOREIGN KEY FK_29D6873E82F1BAF4');
$this->addSql('DROP INDEX IDX_29D6873E82F1BAF4 ON offer');
$this->addSql('ALTER TABLE task CHANGE name name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE tranche DROP billable_value');
}
}