<?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 Version20220114093059 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('CREATE SEQUENCE history_send_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE history_send (id INT NOT NULL, order_id_id UUID NOT NULL, timestamp TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, status INT NOT NULL, response TEXT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_AC464AB1FCDAEAAA ON history_send (order_id_id)');
$this->addSql('COMMENT ON COLUMN history_send.order_id_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN history_send.timestamp IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('ALTER TABLE history_send ADD CONSTRAINT FK_AC464AB1FCDAEAAA FOREIGN KEY (order_id_id) REFERENCES "order" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
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 history_send_id_seq CASCADE');
$this->addSql('DROP TABLE history_send');
}
}