migrations/Version20220524122950.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. /**
  6.  * Auto-generated Migration: Please modify to your needs!
  7.  */
  8. final class Version20220524122950 extends AbstractMigration
  9. {
  10.     public function getDescription(): string
  11.     {
  12.         return '';
  13.     }
  14.     public function up(Schema $schema): void
  15.     {
  16.         // this up() migration is auto-generated, please modify it to your needs
  17.         $this->addSql('CREATE TABLE news_translation (id INT AUTO_INCREMENT NOT NULL, news_id INT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT DEFAULT NULL, locale VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_9D5CF320B5A459A0 (news_id), INDEX IDX_9D5CF320B03A8386 (created_by_id), INDEX IDX_9D5CF320896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  18.         $this->addSql('ALTER TABLE news_translation ADD CONSTRAINT FK_9D5CF320B5A459A0 FOREIGN KEY (news_id) REFERENCES news (id)');
  19.         $this->addSql('ALTER TABLE news_translation ADD CONSTRAINT FK_9D5CF320B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  20.         $this->addSql('ALTER TABLE news_translation ADD CONSTRAINT FK_9D5CF320896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('DROP TABLE news_translation');
  26.     }
  27. }