<?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 Version20220825140539 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 joker (id INT AUTO_INCREMENT NOT NULL, joker_rule_id INT NOT NULL, team_id INT NOT NULL, quantity INT NOT NULL, INDEX IDX_94E6D4979E5401DD (joker_rule_id), INDEX IDX_94E6D497296CD8AE (team_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE joker_item (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE joker_rule (id INT AUTO_INCREMENT NOT NULL, joker_item_id INT NOT NULL, session_id INT NOT NULL, default_quantity INT NOT NULL, max_quantity INT NOT NULL, INDEX IDX_69AFEA15F87550D2 (joker_item_id), INDEX IDX_69AFEA15613FECDF (session_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE joker ADD CONSTRAINT FK_94E6D4979E5401DD FOREIGN KEY (joker_rule_id) REFERENCES joker_rule (id)');
$this->addSql('ALTER TABLE joker ADD CONSTRAINT FK_94E6D497296CD8AE FOREIGN KEY (team_id) REFERENCES team (id)');
$this->addSql('ALTER TABLE joker_rule ADD CONSTRAINT FK_69AFEA15F87550D2 FOREIGN KEY (joker_item_id) REFERENCES joker_item (id)');
$this->addSql('ALTER TABLE joker_rule ADD CONSTRAINT FK_69AFEA15613FECDF FOREIGN KEY (session_id) REFERENCES session (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE joker_rule DROP FOREIGN KEY FK_69AFEA15F87550D2');
$this->addSql('ALTER TABLE joker DROP FOREIGN KEY FK_94E6D4979E5401DD');
$this->addSql('DROP TABLE joker');
$this->addSql('DROP TABLE joker_item');
$this->addSql('DROP TABLE joker_rule');
}
}