migrations/Version20221205083335.php line 1

Open in your IDE?
  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 Version20221205083335 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 SEQUENCE cron_job_id_seq CASCADE');
  19.         $this->addSql('DROP SEQUENCE cron_report_id_seq CASCADE');
  20.         $this->addSql('CREATE SEQUENCE supplier_send_log_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  21.         $this->addSql('CREATE TABLE supplier_send_log (id INT NOT NULL, supplier_send_id INT DEFAULT NULL, supplier INT NOT NULL, PRIMARY KEY(id))');
  22.         $this->addSql('CREATE INDEX IDX_AEA6535D92F64A64 ON supplier_send_log (supplier_send_id)');
  23.         $this->addSql('ALTER TABLE supplier_send_log ADD CONSTRAINT FK_AEA6535D92F64A64 FOREIGN KEY (supplier_send_id) REFERENCES raport_send_supplier_send (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  24.         $this->addSql('ALTER TABLE cron_report DROP CONSTRAINT fk_b6c6a7f5be04ea9');
  25.         $this->addSql('DROP TABLE cron_report');
  26.         $this->addSql('DROP TABLE cron_job');
  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 SCHEMA public');
  32.         $this->addSql('DROP SEQUENCE supplier_send_log_id_seq CASCADE');
  33.         $this->addSql('CREATE SEQUENCE cron_job_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  34.         $this->addSql('CREATE SEQUENCE cron_report_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  35.         $this->addSql('CREATE TABLE cron_report (id INT NOT NULL, job_id INT DEFAULT NULL, run_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, run_time DOUBLE PRECISION NOT NULL, exit_code INT NOT NULL, output TEXT NOT NULL, error TEXT NOT NULL, PRIMARY KEY(id))');
  36.         $this->addSql('CREATE INDEX idx_b6c6a7f5be04ea9 ON cron_report (job_id)');
  37.         $this->addSql('CREATE TABLE cron_job (id INT NOT NULL, name VARCHAR(191) NOT NULL, command VARCHAR(1024) NOT NULL, schedule VARCHAR(191) NOT NULL, description VARCHAR(191) NOT NULL, enabled BOOLEAN NOT NULL, PRIMARY KEY(id))');
  38.         $this->addSql('CREATE UNIQUE INDEX un_name ON cron_job (name)');
  39.         $this->addSql('ALTER TABLE cron_report ADD CONSTRAINT fk_b6c6a7f5be04ea9 FOREIGN KEY (job_id) REFERENCES cron_job (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
  40.         $this->addSql('ALTER TABLE supplier_send_log DROP CONSTRAINT FK_AEA6535D92F64A64');
  41.         $this->addSql('DROP TABLE supplier_send_log');
  42.     }
  43. }