<?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 Version20240611143700 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 notifications_system (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT NOT NULL, schedule_at DATETIME DEFAULT NULL, slug VARCHAR(255) DEFAULT NULL, is_launched TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE notifications_system_pivot_user (id INT AUTO_INCREMENT NOT NULL, notification_system_id INT NOT NULL, user_id INT NOT NULL, readed_at DATETIME DEFAULT NULL, INDEX IDX_1C10F45C767C68FA (notification_system_id), INDEX IDX_1C10F45CA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE notifications_system_pivot_user ADD CONSTRAINT FK_1C10F45C767C68FA FOREIGN KEY (notification_system_id) REFERENCES notifications_system (id)');
$this->addSql('ALTER TABLE notifications_system_pivot_user ADD CONSTRAINT FK_1C10F45CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE notifications_system_pivot_user DROP FOREIGN KEY FK_1C10F45C767C68FA');
$this->addSql('DROP TABLE notifications_system');
$this->addSql('DROP TABLE notifications_system_pivot_user');
}
}