<?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 Version20230607071017 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 TABLE notification (id INT AUTO_INCREMENT NOT NULL, webhook_id INT DEFAULT NULL, order_id INT DEFAULT NULL, customer_id INT DEFAULT NULL, state VARCHAR(255) NOT NULL, responses JSON NOT NULL, retries SMALLINT NOT NULL, notified TINYINT(1) NOT NULL, action VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_BF5476CA5C9BA60B (webhook_id), INDEX IDX_BF5476CA8D9F6D38 (order_id), INDEX IDX_BF5476CA9395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_BF5476CA5C9BA60B FOREIGN KEY (webhook_id) REFERENCES webhook (id)');
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_BF5476CA8D9F6D38 FOREIGN KEY (order_id) REFERENCES `order` (id)');
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_BF5476CA9395C3F3 FOREIGN KEY (customer_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB255C9BA60B');
$this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB258D9F6D38');
$this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB259395C3F3');
$this->addSql('DROP TABLE task');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE task (id INT AUTO_INCREMENT NOT NULL, webhook_id INT DEFAULT NULL, order_id INT DEFAULT NULL, customer_id INT DEFAULT NULL, retries SMALLINT NOT NULL, state VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, responses JSON NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, notified TINYINT(1) NOT NULL, action VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_527EDB255C9BA60B (webhook_id), INDEX FK_527EDB259395C3F3 (customer_id), INDEX IDX_527EDB258D9F6D38 (order_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB255C9BA60B FOREIGN KEY (webhook_id) REFERENCES webhook (id)');
$this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB258D9F6D38 FOREIGN KEY (order_id) REFERENCES `order` (id)');
$this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB259395C3F3 FOREIGN KEY (customer_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE notification DROP FOREIGN KEY FK_BF5476CA5C9BA60B');
$this->addSql('ALTER TABLE notification DROP FOREIGN KEY FK_BF5476CA8D9F6D38');
$this->addSql('ALTER TABLE notification DROP FOREIGN KEY FK_BF5476CA9395C3F3');
$this->addSql('DROP TABLE notification');
}
}