<?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 Version20230525080734 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 language (id INT AUTO_INCREMENT NOT NULL, language_name VARCHAR(255) NOT NULL, language_shortname VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE reward_notification (id INT AUTO_INCREMENT NOT NULL, reward_id INT NOT NULL, language_id INT NOT NULL, notification_title VARCHAR(255) NOT NULL, notification_body LONGTEXT NOT NULL, INDEX IDX_D79C50DFE466ACA1 (reward_id), INDEX IDX_D79C50DF82F1BAF4 (language_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE rewards (id INT AUTO_INCREMENT NOT NULL, reward_name VARCHAR(255) NOT NULL, points INT NOT NULL, deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE reward_notification ADD CONSTRAINT FK_D79C50DFE466ACA1 FOREIGN KEY (reward_id) REFERENCES rewards (id)');
$this->addSql('ALTER TABLE reward_notification ADD CONSTRAINT FK_D79C50DF82F1BAF4 FOREIGN KEY (language_id) REFERENCES language (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE reward_notification DROP FOREIGN KEY FK_D79C50DF82F1BAF4');
$this->addSql('ALTER TABLE reward_notification DROP FOREIGN KEY FK_D79C50DFE466ACA1');
$this->addSql('DROP TABLE language');
$this->addSql('DROP TABLE reward_notification');
$this->addSql('DROP TABLE rewards');
}
}