Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

35 lines
2.2KB

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