<?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 Version20190718134859 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE notification_send (`id` INT AUTO_INCREMENT NOT NULL, data VARCHAR(11000) NOT NULL, PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE notification_send_receiver (`id` INT AUTO_INCREMENT NOT NULL, `token` VARCHAR(255) NOT NULL, `userId` VARCHAR(255) NOT NULL, `notification_send_id` INT NOT NULL, INDEX IDX_C1D64375A6984895 (`notification_send_id`), PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE notification_send_receiver ADD CONSTRAINT FK_C1D64375A6984895 FOREIGN KEY (`notification_send_id`) REFERENCES notification_send (`id`) ON DELETE CASCADE');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE notification_send_receiver DROP FOREIGN KEY FK_C1D64375A6984895');
$this->addSql('DROP TABLE notification_send');
$this->addSql('DROP TABLE notification_send_receiver');
}
}