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.

48 lines
3.6KB

  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 Version20220114102625 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 configuration');
  19. $this->addSql('ALTER TABLE file CHANGE created_by_id created_by_id INT DEFAULT NULL, CHANGE updated_by_id updated_by_id INT DEFAULT NULL');
  20. $this->addSql('ALTER TABLE group_user ADD description LONGTEXT DEFAULT NULL, ADD meta_title VARCHAR(255) DEFAULT NULL, ADD meta_description LONGTEXT DEFAULT NULL, ADD old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', ADD slug VARCHAR(255) NOT NULL, ADD position DOUBLE PRECISION NOT NULL, ADD status DOUBLE PRECISION NOT NULL, CHANGE created_by_id created_by_id INT DEFAULT NULL, CHANGE updated_by_id updated_by_id INT DEFAULT NULL');
  21. $this->addSql('ALTER TABLE page CHANGE created_by_id created_by_id INT DEFAULT NULL, CHANGE updated_by_id updated_by_id INT DEFAULT NULL');
  22. $this->addSql('ALTER TABLE reminder CHANGE created_by_id created_by_id INT DEFAULT NULL, CHANGE updated_by_id updated_by_id INT DEFAULT NULL');
  23. $this->addSql('ALTER TABLE site_setting CHANGE name name VARCHAR(63) DEFAULT NULL');
  24. $this->addSql('ALTER TABLE ticket CHANGE created_by_id created_by_id INT DEFAULT NULL, CHANGE updated_by_id updated_by_id INT DEFAULT NULL');
  25. $this->addSql('ALTER TABLE ticket_message CHANGE created_by_id created_by_id INT DEFAULT NULL, CHANGE updated_by_id updated_by_id INT DEFAULT NULL');
  26. $this->addSql('ALTER TABLE user ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL');
  27. }
  28. public function down(Schema $schema): void
  29. {
  30. // this down() migration is auto-generated, please modify it to your needs
  31. $this->addSql('CREATE TABLE configuration (id INT AUTO_INCREMENT NOT NULL, value VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, dev_alias VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  32. $this->addSql('ALTER TABLE file CHANGE created_by_id created_by_id INT NOT NULL, CHANGE updated_by_id updated_by_id INT NOT NULL');
  33. $this->addSql('ALTER TABLE group_user DROP description, DROP meta_title, DROP meta_description, DROP old_urls, DROP slug, DROP position, DROP status, CHANGE created_by_id created_by_id INT NOT NULL, CHANGE updated_by_id updated_by_id INT NOT NULL');
  34. $this->addSql('ALTER TABLE page CHANGE created_by_id created_by_id INT NOT NULL, CHANGE updated_by_id updated_by_id INT NOT NULL');
  35. $this->addSql('ALTER TABLE reminder CHANGE created_by_id created_by_id INT NOT NULL, CHANGE updated_by_id updated_by_id INT NOT NULL');
  36. $this->addSql('ALTER TABLE site_setting CHANGE name name VARCHAR(63) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
  37. $this->addSql('ALTER TABLE ticket CHANGE created_by_id created_by_id INT NOT NULL, CHANGE updated_by_id updated_by_id INT NOT NULL');
  38. $this->addSql('ALTER TABLE ticket_message CHANGE created_by_id created_by_id INT NOT NULL, CHANGE updated_by_id updated_by_id INT NOT NULL');
  39. $this->addSql('ALTER TABLE user DROP created_at, DROP updated_at');
  40. }
  41. }