<?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 Version20220228175224 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 artifact_entity_place (artifact_entity_id INTEGER NOT NULL, place_id INTEGER NOT NULL, PRIMARY KEY(artifact_entity_id, place_id))');
$this->addSql('CREATE INDEX IDX_582BD22A796FAEA1 ON artifact_entity_place (artifact_entity_id)');
$this->addSql('CREATE INDEX IDX_582BD22ADA6A219 ON artifact_entity_place (place_id)');
$this->addSql('CREATE TEMPORARY TABLE __temp__artifact_entity AS SELECT id, name, hp_max, hp FROM artifact_entity');
$this->addSql('DROP TABLE artifact_entity');
$this->addSql('CREATE TABLE artifact_entity (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, place_id INTEGER DEFAULT NULL, name VARCHAR(255) NOT NULL, hp_max INTEGER NOT NULL, hp INTEGER NOT NULL, description CLOB DEFAULT NULL --(DC2Type:array)
, CONSTRAINT FK_4966C724DA6A219 FOREIGN KEY (place_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO artifact_entity (id, name, hp_max, hp) SELECT id, name, hp_max, hp FROM __temp__artifact_entity');
$this->addSql('DROP TABLE __temp__artifact_entity');
$this->addSql('CREATE INDEX IDX_4966C724DA6A219 ON artifact_entity (place_id)');
$this->addSql('DROP INDEX IDX_B6BD307FD1741030');
$this->addSql('DROP INDEX IDX_B6BD307F2239FAB1');
$this->addSql('CREATE TEMPORARY TABLE __temp__message AS SELECT id, place_origin_id, playable_entity_origin_id, date_time, content FROM message');
$this->addSql('DROP TABLE message');
$this->addSql('CREATE TABLE message (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, place_origin_id INTEGER DEFAULT NULL, playable_entity_origin_id INTEGER DEFAULT NULL, date_time DATETIME NOT NULL --(DC2Type:datetime_immutable)
, content CLOB NOT NULL, CONSTRAINT FK_B6BD307F2239FAB1 FOREIGN KEY (place_origin_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_B6BD307FD1741030 FOREIGN KEY (playable_entity_origin_id) REFERENCES playable_entity (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO message (id, place_origin_id, playable_entity_origin_id, date_time, content) SELECT id, place_origin_id, playable_entity_origin_id, date_time, content FROM __temp__message');
$this->addSql('DROP TABLE __temp__message');
$this->addSql('CREATE INDEX IDX_B6BD307FD1741030 ON message (playable_entity_origin_id)');
$this->addSql('CREATE INDEX IDX_B6BD307F2239FAB1 ON message (place_origin_id)');
$this->addSql('DROP INDEX IDX_B548B0F816C6140');
$this->addSql('DROP INDEX IDX_B548B0F56A273CC');
$this->addSql('CREATE TEMPORARY TABLE __temp__path AS SELECT id, origin_id, destination_id, name, position FROM path');
$this->addSql('DROP TABLE path');
$this->addSql('CREATE TABLE path (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, origin_id INTEGER NOT NULL, destination_id INTEGER NOT NULL, name VARCHAR(255) NOT NULL, position SMALLINT NOT NULL, CONSTRAINT FK_B548B0F56A273CC FOREIGN KEY (origin_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_B548B0F816C6140 FOREIGN KEY (destination_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO path (id, origin_id, destination_id, name, position) SELECT id, origin_id, destination_id, name, position FROM __temp__path');
$this->addSql('DROP TABLE __temp__path');
$this->addSql('CREATE INDEX IDX_B548B0F816C6140 ON path (destination_id)');
$this->addSql('CREATE INDEX IDX_B548B0F56A273CC ON path (origin_id)');
$this->addSql('ALTER TABLE place ADD COLUMN description CLOB DEFAULT NULL');
$this->addSql('DROP INDEX IDX_114242BEDA6A219');
$this->addSql('DROP INDEX IDX_114242BE99E6F5DF');
$this->addSql('CREATE TEMPORARY TABLE __temp__playable_entity AS SELECT id, player_id, place_id, name, gender, trombinoscope, size, hp, ap, max_hp, max_ap, armor_class, agility, charisma, intelligence, perception, strength, skills, abilities, known_magicskills, known_attackskills, known_craftskills FROM playable_entity');
$this->addSql('DROP TABLE playable_entity');
$this->addSql('CREATE TABLE playable_entity (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, player_id INTEGER DEFAULT NULL, place_id INTEGER DEFAULT NULL, name VARCHAR(255) NOT NULL, gender SMALLINT NOT NULL, trombinoscope CLOB DEFAULT NULL --(DC2Type:array)
, size SMALLINT NOT NULL, hp INTEGER NOT NULL, ap INTEGER NOT NULL, max_hp INTEGER NOT NULL, max_ap INTEGER NOT NULL, armor_class INTEGER NOT NULL, agility INTEGER NOT NULL, charisma INTEGER NOT NULL, intelligence INTEGER NOT NULL, perception INTEGER NOT NULL, strength INTEGER NOT NULL, skills CLOB DEFAULT NULL --(DC2Type:array)
, abilities CLOB DEFAULT NULL --(DC2Type:array)
, known_magicskills CLOB DEFAULT NULL --(DC2Type:array)
, known_attackskills CLOB DEFAULT NULL --(DC2Type:array)
, known_craftskills CLOB DEFAULT NULL --(DC2Type:array)
, race VARCHAR(255) NOT NULL, description CLOB DEFAULT NULL --(DC2Type:array)
, CONSTRAINT FK_114242BE99E6F5DF FOREIGN KEY (player_id) REFERENCES user (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_114242BEDA6A219 FOREIGN KEY (place_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO playable_entity (id, player_id, place_id, name, gender, trombinoscope, size, hp, ap, max_hp, max_ap, armor_class, agility, charisma, intelligence, perception, strength, skills, abilities, known_magicskills, known_attackskills, known_craftskills) SELECT id, player_id, place_id, name, gender, trombinoscope, size, hp, ap, max_hp, max_ap, armor_class, agility, charisma, intelligence, perception, strength, skills, abilities, known_magicskills, known_attackskills, known_craftskills FROM __temp__playable_entity');
$this->addSql('DROP TABLE __temp__playable_entity');
$this->addSql('CREATE INDEX IDX_114242BEDA6A219 ON playable_entity (place_id)');
$this->addSql('CREATE INDEX IDX_114242BE99E6F5DF ON playable_entity (player_id)');
$this->addSql('DROP INDEX IDX_86A7E937DA6A219');
$this->addSql('CREATE TEMPORARY TABLE __temp__unplayable_entity AS SELECT id, place_id, name, hp, hp_max, ap, ap_max, armor_class FROM unplayable_entity');
$this->addSql('DROP TABLE unplayable_entity');
$this->addSql('CREATE TABLE unplayable_entity (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, place_id INTEGER DEFAULT NULL, name VARCHAR(255) NOT NULL, hp INTEGER NOT NULL, hp_max INTEGER NOT NULL, ap INTEGER NOT NULL, ap_max INTEGER NOT NULL, armor_class INTEGER NOT NULL, description CLOB DEFAULT NULL --(DC2Type:array)
, CONSTRAINT FK_86A7E937DA6A219 FOREIGN KEY (place_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO unplayable_entity (id, place_id, name, hp, hp_max, ap, ap_max, armor_class) SELECT id, place_id, name, hp, hp_max, ap, ap_max, armor_class FROM __temp__unplayable_entity');
$this->addSql('DROP TABLE __temp__unplayable_entity');
$this->addSql('CREATE INDEX IDX_86A7E937DA6A219 ON unplayable_entity (place_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE artifact_entity_place');
$this->addSql('DROP INDEX IDX_4966C724DA6A219');
$this->addSql('CREATE TEMPORARY TABLE __temp__artifact_entity AS SELECT id, name, hp_max, hp FROM artifact_entity');
$this->addSql('DROP TABLE artifact_entity');
$this->addSql('CREATE TABLE artifact_entity (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL, hp_max INTEGER NOT NULL, hp INTEGER NOT NULL)');
$this->addSql('INSERT INTO artifact_entity (id, name, hp_max, hp) SELECT id, name, hp_max, hp FROM __temp__artifact_entity');
$this->addSql('DROP TABLE __temp__artifact_entity');
$this->addSql('DROP INDEX IDX_B6BD307F2239FAB1');
$this->addSql('DROP INDEX IDX_B6BD307FD1741030');
$this->addSql('CREATE TEMPORARY TABLE __temp__message AS SELECT id, place_origin_id, playable_entity_origin_id, date_time, content FROM message');
$this->addSql('DROP TABLE message');
$this->addSql('CREATE TABLE message (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, place_origin_id INTEGER DEFAULT NULL, playable_entity_origin_id INTEGER DEFAULT NULL, date_time DATETIME NOT NULL --(DC2Type:datetime_immutable)
, content CLOB NOT NULL)');
$this->addSql('INSERT INTO message (id, place_origin_id, playable_entity_origin_id, date_time, content) SELECT id, place_origin_id, playable_entity_origin_id, date_time, content FROM __temp__message');
$this->addSql('DROP TABLE __temp__message');
$this->addSql('CREATE INDEX IDX_B6BD307F2239FAB1 ON message (place_origin_id)');
$this->addSql('CREATE INDEX IDX_B6BD307FD1741030 ON message (playable_entity_origin_id)');
$this->addSql('DROP INDEX IDX_B548B0F56A273CC');
$this->addSql('DROP INDEX IDX_B548B0F816C6140');
$this->addSql('CREATE TEMPORARY TABLE __temp__path AS SELECT id, origin_id, destination_id, name, position FROM path');
$this->addSql('DROP TABLE path');
$this->addSql('CREATE TABLE path (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, origin_id INTEGER NOT NULL, destination_id INTEGER NOT NULL, name VARCHAR(255) NOT NULL, position SMALLINT NOT NULL)');
$this->addSql('INSERT INTO path (id, origin_id, destination_id, name, position) SELECT id, origin_id, destination_id, name, position FROM __temp__path');
$this->addSql('DROP TABLE __temp__path');
$this->addSql('CREATE INDEX IDX_B548B0F56A273CC ON path (origin_id)');
$this->addSql('CREATE INDEX IDX_B548B0F816C6140 ON path (destination_id)');
$this->addSql('CREATE TEMPORARY TABLE __temp__place AS SELECT id, name FROM place');
$this->addSql('DROP TABLE place');
$this->addSql('CREATE TABLE place (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL)');
$this->addSql('INSERT INTO place (id, name) SELECT id, name FROM __temp__place');
$this->addSql('DROP TABLE __temp__place');
$this->addSql('DROP INDEX IDX_114242BE99E6F5DF');
$this->addSql('DROP INDEX IDX_114242BEDA6A219');
$this->addSql('CREATE TEMPORARY TABLE __temp__playable_entity AS SELECT id, player_id, place_id, name, gender, trombinoscope, size, hp, ap, max_hp, max_ap, armor_class, agility, charisma, intelligence, perception, strength, skills, abilities, known_magicskills, known_attackskills, known_craftskills FROM playable_entity');
$this->addSql('DROP TABLE playable_entity');
$this->addSql('CREATE TABLE playable_entity (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, player_id INTEGER DEFAULT NULL, place_id INTEGER DEFAULT NULL, name VARCHAR(255) NOT NULL, gender SMALLINT NOT NULL, trombinoscope CLOB DEFAULT NULL --(DC2Type:array)
, size SMALLINT NOT NULL, hp INTEGER NOT NULL, ap INTEGER NOT NULL, max_hp INTEGER NOT NULL, max_ap INTEGER NOT NULL, armor_class INTEGER NOT NULL, agility INTEGER NOT NULL, charisma INTEGER NOT NULL, intelligence INTEGER NOT NULL, perception INTEGER NOT NULL, strength INTEGER NOT NULL, skills CLOB DEFAULT NULL --(DC2Type:array)
, abilities CLOB DEFAULT NULL --(DC2Type:array)
, known_magicskills CLOB DEFAULT NULL --(DC2Type:array)
, known_attackskills CLOB DEFAULT NULL --(DC2Type:array)
, known_craftskills CLOB DEFAULT NULL --(DC2Type:array)
)');
$this->addSql('INSERT INTO playable_entity (id, player_id, place_id, name, gender, trombinoscope, size, hp, ap, max_hp, max_ap, armor_class, agility, charisma, intelligence, perception, strength, skills, abilities, known_magicskills, known_attackskills, known_craftskills) SELECT id, player_id, place_id, name, gender, trombinoscope, size, hp, ap, max_hp, max_ap, armor_class, agility, charisma, intelligence, perception, strength, skills, abilities, known_magicskills, known_attackskills, known_craftskills FROM __temp__playable_entity');
$this->addSql('DROP TABLE __temp__playable_entity');
$this->addSql('CREATE INDEX IDX_114242BE99E6F5DF ON playable_entity (player_id)');
$this->addSql('CREATE INDEX IDX_114242BEDA6A219 ON playable_entity (place_id)');
$this->addSql('DROP INDEX IDX_86A7E937DA6A219');
$this->addSql('CREATE TEMPORARY TABLE __temp__unplayable_entity AS SELECT id, place_id, name, hp, hp_max, ap, ap_max, armor_class FROM unplayable_entity');
$this->addSql('DROP TABLE unplayable_entity');
$this->addSql('CREATE TABLE unplayable_entity (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, place_id INTEGER DEFAULT NULL, name VARCHAR(255) NOT NULL, hp INTEGER NOT NULL, hp_max INTEGER NOT NULL, ap INTEGER NOT NULL, ap_max INTEGER NOT NULL, armor_class INTEGER NOT NULL)');
$this->addSql('INSERT INTO unplayable_entity (id, place_id, name, hp, hp_max, ap, ap_max, armor_class) SELECT id, place_id, name, hp, hp_max, ap, ap_max, armor_class FROM __temp__unplayable_entity');
$this->addSql('DROP TABLE __temp__unplayable_entity');
$this->addSql('CREATE INDEX IDX_86A7E937DA6A219 ON unplayable_entity (place_id)');
}
}