migrations/Version20220923184244.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220923184244 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $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');
  20.         $this->addSql('ALTER TABLE translations ADD CONSTRAINT FK_C6B7DA87979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
  21.         $this->addSql('ALTER TABLE translations ADD CONSTRAINT FK_C6B7DA871CBE8B91 FOREIGN KEY (from_language_id) REFERENCES country (id)');
  22.         $this->addSql('ALTER TABLE translations ADD CONSTRAINT FK_C6B7DA87AC628497 FOREIGN KEY (to_language_id) REFERENCES country (id)');
  23.         $this->addSql('ALTER TABLE translations ADD CONSTRAINT FK_C6B7DA8733663AF7 FOREIGN KEY (service_status_id) REFERENCES service_status (id)');
  24.         $this->addSql('ALTER TABLE translations_files ADD CONSTRAINT FK_597A738C9CAA2B25 FOREIGN KEY (translation_id) REFERENCES translations (id)');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('ALTER TABLE translations_files DROP FOREIGN KEY FK_597A738C9CAA2B25');
  30.         $this->addSql('DROP TABLE translations');
  31.         $this->addSql('DROP TABLE translations_files');
  32.     }
  33. }