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.

52 lines
3.8KB

  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 Version20210604073921 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 merchant_config DROP FOREIGN KEY FK_3CA56895E511F091');
  19. $this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA56895F5B7AF75');
  20. $this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA56895FDD13F95');
  21. $this->addSql('DROP INDEX UNIQ_3CA56895E511F091 ON merchant_config');
  22. $this->addSql('DROP INDEX UNIQ_3CA56895F5B7AF75 ON merchant_config');
  23. $this->addSql('DROP INDEX IDX_3CA56895FDD13F95 ON merchant_config');
  24. $this->addSql('ALTER TABLE merchant_config ADD image_id INT DEFAULT NULL, ADD name VARCHAR(63) NOT NULL, ADD value LONGTEXT DEFAULT NULL, DROP credit_config_id, DROP address_id, DROP title, DROP description, DROP meta_title, DROP meta_description, DROP old_urls, DROP slug, DROP position, DROP status, CHANGE tax_rate_id merchant_id INT NOT NULL');
  25. $this->addSql('ALTER TABLE merchant_config ADD CONSTRAINT FK_3CA568956796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
  26. $this->addSql('ALTER TABLE merchant_config ADD CONSTRAINT FK_3CA568953DA5256D FOREIGN KEY (image_id) REFERENCES file (id)');
  27. $this->addSql('CREATE INDEX IDX_3CA568956796D554 ON merchant_config (merchant_id)');
  28. $this->addSql('CREATE INDEX IDX_3CA568953DA5256D ON merchant_config (image_id)');
  29. }
  30. public function down(Schema $schema): void
  31. {
  32. // this down() migration is auto-generated, please modify it to your needs
  33. $this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA568956796D554');
  34. $this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA568953DA5256D');
  35. $this->addSql('DROP INDEX IDX_3CA568956796D554 ON merchant_config');
  36. $this->addSql('DROP INDEX IDX_3CA568953DA5256D ON merchant_config');
  37. $this->addSql('ALTER TABLE merchant_config ADD address_id INT DEFAULT NULL, ADD title VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD meta_title VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD meta_description LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD old_urls LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:array)\', ADD slug VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD position DOUBLE PRECISION NOT NULL, ADD status DOUBLE PRECISION NOT NULL, DROP name, CHANGE image_id credit_config_id INT DEFAULT NULL, CHANGE merchant_id tax_rate_id INT NOT NULL, CHANGE value description LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
  38. $this->addSql('ALTER TABLE merchant_config ADD CONSTRAINT FK_3CA56895E511F091 FOREIGN KEY (credit_config_id) REFERENCES credit_config (id)');
  39. $this->addSql('ALTER TABLE merchant_config ADD CONSTRAINT FK_3CA56895F5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
  40. $this->addSql('ALTER TABLE merchant_config ADD CONSTRAINT FK_3CA56895FDD13F95 FOREIGN KEY (tax_rate_id) REFERENCES tax_rate (id)');
  41. $this->addSql('CREATE UNIQUE INDEX UNIQ_3CA56895E511F091 ON merchant_config (credit_config_id)');
  42. $this->addSql('CREATE UNIQUE INDEX UNIQ_3CA56895F5B7AF75 ON merchant_config (address_id)');
  43. $this->addSql('CREATE INDEX IDX_3CA56895FDD13F95 ON merchant_config (tax_rate_id)');
  44. }
  45. }