Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

48 lines
3.4KB

  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 Version20210624083555 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 DROP FOREIGN KEY FK_74AB25E1E511F091');
  19. $this->addSql('CREATE TABLE opening (id INT AUTO_INCREMENT NOT NULL, section_id INT NOT NULL, day INT NOT NULL, time_start TIME DEFAULT NULL, time_end TIME DEFAULT NULL, INDEX IDX_E35D4C3D823E37A (section_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20. $this->addSql('ALTER TABLE opening ADD CONSTRAINT FK_E35D4C3D823E37A FOREIGN KEY (section_id) REFERENCES section (id)');
  21. $this->addSql('DROP TABLE credit_config');
  22. $this->addSql('DROP TABLE point_sale_day_info');
  23. $this->addSql('DROP INDEX UNIQ_74AB25E1E511F091 ON merchant');
  24. $this->addSql('ALTER TABLE merchant DROP credit_config_id');
  25. $this->addSql('ALTER TABLE order_shop ADD cycle_id INT DEFAULT NULL');
  26. }
  27. public function down(Schema $schema): void
  28. {
  29. // this down() migration is auto-generated, please modify it to your needs
  30. $this->addSql('CREATE TABLE credit_config (id INT AUTO_INCREMENT NOT NULL, active TINYINT(1) NOT NULL, limit_amount DOUBLE PRECISION DEFAULT NULL, limit_reminder DOUBLE PRECISION DEFAULT NULL, behavior VARCHAR(31) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, process_order_checked_default TINYINT(1) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  31. $this->addSql('CREATE TABLE point_sale_day_info (id INT AUTO_INCREMENT NOT NULL, point_sale_id INT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, active TINYINT(1) NOT NULL, day SMALLINT NOT NULL, description LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, dev_alias VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_34BC1A33896DBBDE (updated_by_id), INDEX IDX_34BC1A33FDAAB1A4 (point_sale_id), INDEX IDX_34BC1A33B03A8386 (created_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  32. $this->addSql('ALTER TABLE point_sale_day_info ADD CONSTRAINT FK_34BC1A33896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  33. $this->addSql('ALTER TABLE point_sale_day_info ADD CONSTRAINT FK_34BC1A33B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  34. $this->addSql('ALTER TABLE point_sale_day_info ADD CONSTRAINT FK_34BC1A33FDAAB1A4 FOREIGN KEY (point_sale_id) REFERENCES point_sale (id)');
  35. $this->addSql('DROP TABLE opening');
  36. $this->addSql('ALTER TABLE merchant ADD credit_config_id INT DEFAULT NULL');
  37. $this->addSql('ALTER TABLE merchant ADD CONSTRAINT FK_74AB25E1E511F091 FOREIGN KEY (credit_config_id) REFERENCES credit_config (id)');
  38. $this->addSql('CREATE UNIQUE INDEX UNIQ_74AB25E1E511F091 ON merchant (credit_config_id)');
  39. $this->addSql('ALTER TABLE order_shop DROP cycle_id');
  40. }
  41. }