<?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 Version20220923184244 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 translations (id INT AUTO_INCREMENT NOT NULL, company_id INT NOT NULL, from_language_id INT NOT NULL, to_language_id INT NOT NULL, service_status_id INT NOT NULL, pages INT NOT NULL, name VARCHAR(255) DEFAULT NULL, data_requested DATETIME DEFAULT NULL, read_date DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_C6B7DA87979B1AD6 (company_id), INDEX IDX_C6B7DA871CBE8B91 (from_language_id), INDEX IDX_C6B7DA87AC628497 (to_language_id), INDEX IDX_C6B7DA8733663AF7 (service_status_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE translations_files (id INT AUTO_INCREMENT NOT NULL, translation_id INT NOT NULL, file_name VARCHAR(255) NOT NULL, file_path VARCHAR(255) NOT NULL, form_file VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_597A738C9CAA2B25 (translation_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE translations ADD CONSTRAINT FK_C6B7DA87979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE translations ADD CONSTRAINT FK_C6B7DA871CBE8B91 FOREIGN KEY (from_language_id) REFERENCES country (id)');
$this->addSql('ALTER TABLE translations ADD CONSTRAINT FK_C6B7DA87AC628497 FOREIGN KEY (to_language_id) REFERENCES country (id)');
$this->addSql('ALTER TABLE translations ADD CONSTRAINT FK_C6B7DA8733663AF7 FOREIGN KEY (service_status_id) REFERENCES service_status (id)');
$this->addSql('ALTER TABLE translations_files ADD CONSTRAINT FK_597A738C9CAA2B25 FOREIGN KEY (translation_id) REFERENCES translations (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE translations_files DROP FOREIGN KEY FK_597A738C9CAA2B25');
$this->addSql('DROP TABLE translations');
$this->addSql('DROP TABLE translations_files');
}
}