<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221205083335 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('DROP SEQUENCE cron_job_id_seq CASCADE');
$this->addSql('DROP SEQUENCE cron_report_id_seq CASCADE');
$this->addSql('CREATE SEQUENCE supplier_send_log_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE supplier_send_log (id INT NOT NULL, supplier_send_id INT DEFAULT NULL, supplier INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_AEA6535D92F64A64 ON supplier_send_log (supplier_send_id)');
$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');
$this->addSql('ALTER TABLE cron_report DROP CONSTRAINT fk_b6c6a7f5be04ea9');
$this->addSql('DROP TABLE cron_report');
$this->addSql('DROP TABLE cron_job');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('DROP SEQUENCE supplier_send_log_id_seq CASCADE');
$this->addSql('CREATE SEQUENCE cron_job_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE cron_report_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$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))');
$this->addSql('CREATE INDEX idx_b6c6a7f5be04ea9 ON cron_report (job_id)');
$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))');
$this->addSql('CREATE UNIQUE INDEX un_name ON cron_job (name)');
$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');
$this->addSql('ALTER TABLE supplier_send_log DROP CONSTRAINT FK_AEA6535D92F64A64');
$this->addSql('DROP TABLE supplier_send_log');
}
}