<?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 Version20230321113618 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('DROP TABLE contracts');
$this->addSql('ALTER TABLE offer_body ADD accepted TINYINT(1) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE contracts (id INT AUTO_INCREMENT NOT NULL, contract_type_id INT NOT NULL, company_id INT NOT NULL, nr VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, data_din DATE DEFAULT NULL, contrac_txt LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, year_share DATE DEFAULT NULL, anexa LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, start_date DATE DEFAULT NULL, end_date DATE DEFAULT NULL, total_paid NUMERIC(20, 2) DEFAULT NULL, unit_price NUMERIC(20, 2) DEFAULT NULL, interval_of_unit_price INT DEFAULT NULL, duration_mounth INT DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_950A973CD1DF15B (contract_type_id), INDEX IDX_950A973979B1AD6 (company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE contracts ADD CONSTRAINT FK_950A973979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE contracts ADD CONSTRAINT FK_950A973CD1DF15B FOREIGN KEY (contract_type_id) REFERENCES project_type (id)');
$this->addSql('ALTER TABLE offer_body DROP accepted');
}
}