You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
2.0KB

  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 Version20210514135359 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 news (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, date_event DATETIME DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_1DD399503DA5256D (image_id), INDEX IDX_1DD39950B03A8386 (created_by_id), INDEX IDX_1DD39950896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19. $this->addSql('ALTER TABLE news ADD CONSTRAINT FK_1DD399503DA5256D FOREIGN KEY (image_id) REFERENCES file (id)');
  20. $this->addSql('ALTER TABLE news ADD CONSTRAINT FK_1DD39950B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  21. $this->addSql('ALTER TABLE news ADD CONSTRAINT FK_1DD39950896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  22. $this->addSql('ALTER TABLE page DROP locales_enabled');
  23. }
  24. public function down(Schema $schema) : void
  25. {
  26. // this down() migration is auto-generated, please modify it to your needs
  27. $this->addSql('DROP TABLE news');
  28. $this->addSql('ALTER TABLE page ADD locales_enabled LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:array)\'');
  29. }
  30. }