Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

Version20210616070418.php 2.5KB

3 lat temu
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 Version20210616070418 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('ALTER TABLE news DROP is_sent');
  19. $this->addSql('ALTER TABLE reminder ADD section_id INT DEFAULT NULL, ADD crud_action VARCHAR(64) DEFAULT NULL, ADD crud_controller_fqcn VARCHAR(255) DEFAULT NULL, DROP entity_name, DROP entity_action');
  20. $this->addSql('ALTER TABLE reminder ADD CONSTRAINT FK_40374F40D823E37A FOREIGN KEY (section_id) REFERENCES section (id)');
  21. $this->addSql('CREATE INDEX IDX_40374F40D823E37A ON reminder (section_id)');
  22. $this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA36796D554');
  23. $this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA3BB6C6D96');
  24. $this->addSql('DROP INDEX IDX_97A0ADA36796D554 ON ticket');
  25. $this->addSql('DROP INDEX IDX_97A0ADA3BB6C6D96 ON ticket');
  26. $this->addSql('ALTER TABLE ticket DROP merchant_id, DROP order_shop_id');
  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('ALTER TABLE news ADD is_sent TINYINT(1) DEFAULT NULL');
  32. $this->addSql('ALTER TABLE reminder DROP FOREIGN KEY FK_40374F40D823E37A');
  33. $this->addSql('DROP INDEX IDX_40374F40D823E37A ON reminder');
  34. $this->addSql('ALTER TABLE reminder ADD entity_action VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, DROP section_id, DROP crud_action, CHANGE crud_controller_fqcn entity_name VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
  35. $this->addSql('ALTER TABLE ticket ADD merchant_id INT NOT NULL, ADD order_shop_id INT DEFAULT NULL');
  36. $this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA36796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
  37. $this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA3BB6C6D96 FOREIGN KEY (order_shop_id) REFERENCES order_shop (id)');
  38. $this->addSql('CREATE INDEX IDX_97A0ADA36796D554 ON ticket (merchant_id)');
  39. $this->addSql('CREATE INDEX IDX_97A0ADA3BB6C6D96 ON ticket (order_shop_id)');
  40. }
  41. }