<?php
declare(strict_types=1);
namespace SalesBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240702095950 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE sales_bundle__relaunch_level (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', days INT NOT NULL, subject VARCHAR(255) DEFAULT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_A4283B2FB03A8386 (created_by_id), INDEX IDX_A4283B2F896DBBDE (updated_by_id), INDEX IDX_A4283B2FC76F1F52 (deleted_by_id), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE sales_bundle__relaunch_level ADD send_notification TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE sales_bundle__relaunch_level ADD CONSTRAINT FK_A4283B2FB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE sales_bundle__relaunch_level ADD CONSTRAINT FK_A4283B2F896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE sales_bundle__relaunch_level ADD CONSTRAINT FK_A4283B2FC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
}
public function postUp(Schema $schema): void
{
$this->connection->insert('cron_job', [
'name' => 'sales:unpaid-relaunch',
'command' => 'bluue-bundle:sales:unpaid-relaunch',
'schedule' => '0 9 * * *',
'description' => '',
'enabled' => 1
]);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sales_bundle__relaunch_level DROP FOREIGN KEY FK_A4283B2FB03A8386');
$this->addSql('ALTER TABLE sales_bundle__relaunch_level DROP FOREIGN KEY FK_A4283B2F896DBBDE');
$this->addSql('ALTER TABLE sales_bundle__relaunch_level DROP FOREIGN KEY FK_A4283B2FC76F1F52');
$this->addSql('DROP TABLE sales_bundle__relaunch_level');
}
}