<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220401191347 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add notification_log table';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE notification_log (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, type VARCHAR(255) NOT NULL, email VARCHAR(255) DEFAULT NULL, phone_number BIGINT UNSIGNED DEFAULT NULL, created_at DATETIME NOT NULL, INDEX created_at__type (created_at, type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE creator ADD last_notifications JSON NOT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE notification_log');
$this->addSql('ALTER TABLE creator DROP last_notifications');
}
public function isTransactional(): bool
{
return false;
}
}