migrations/Version20220514092054.php line 1

  1. <?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 Version20220514092054 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 item (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, playable_entity_equipped_id INTEGER DEFAULT NULL, unplayable_entity_equipped_id INTEGER DEFAULT NULL, artifact_entity_equipped_id INTEGER DEFAULT NULL, inside_of_id INTEGER DEFAULT NULL, name VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, weight INTEGER NOT NULL, weight_max INTEGER NOT NULL, size VARCHAR(10) NOT NULL, equipped BOOLEAN NOT NULL, container BOOLEAN NOT NULL, value INTEGER DEFAULT NULL)');
            $this->addSql('CREATE INDEX IDX_1F1B251ED171181E ON item (playable_entity_equipped_id)');
            $this->addSql('CREATE INDEX IDX_1F1B251E817C99A1 ON item (unplayable_entity_equipped_id)');
            $this->addSql('CREATE INDEX IDX_1F1B251EDE13AB7A ON item (artifact_entity_equipped_id)');
            $this->addSql('CREATE INDEX IDX_1F1B251ECDEA07EC ON item (inside_of_id)');
            $this->addSql('DROP INDEX IDX_4966C724DA6A219');
            $this->addSql('CREATE TEMPORARY TABLE __temp__artifact_entity AS SELECT id, place_id, name, hp_max, hp, description 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, place_id, name, hp_max, hp, description) SELECT id, place_id, name, hp_max, hp, description 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_582BD22ADA6A219');
            $this->addSql('DROP INDEX IDX_582BD22A796FAEA1');
            $this->addSql('CREATE TEMPORARY TABLE __temp__artifact_entity_place AS SELECT artifact_entity_id, place_id FROM artifact_entity_place');
            $this->addSql('DROP TABLE artifact_entity_place');
            $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), CONSTRAINT FK_582BD22A796FAEA1 FOREIGN KEY (artifact_entity_id) REFERENCES artifact_entity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_582BD22ADA6A219 FOREIGN KEY (place_id) REFERENCES place (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
            $this->addSql('INSERT INTO artifact_entity_place (artifact_entity_id, place_id) SELECT artifact_entity_id, place_id FROM __temp__artifact_entity_place');
            $this->addSql('DROP TABLE __temp__artifact_entity_place');
            $this->addSql('CREATE INDEX IDX_582BD22ADA6A219 ON artifact_entity_place (place_id)');
            $this->addSql('CREATE INDEX IDX_582BD22A796FAEA1 ON artifact_entity_place (artifact_entity_id)');
            $this->addSql('DROP INDEX IDX_8F3F68C553166228');
            $this->addSql('DROP INDEX IDX_8F3F68C57E3C61F9');
            $this->addSql('DROP INDEX IDX_8F3F68C53E10C8E9');
            $this->addSql('DROP INDEX IDX_8F3F68C5A30FFC4C');
            $this->addSql('DROP INDEX IDX_8F3F68C54CCA4D7D');
            $this->addSql('DROP INDEX IDX_8F3F68C569F6B503');
            $this->addSql('DROP INDEX IDX_8F3F68C59A280F8B');
            $this->addSql('DROP INDEX IDX_8F3F68C56C1B4306');
            $this->addSql('DROP INDEX IDX_8F3F68C5B7556913');
            $this->addSql('CREATE TEMPORARY TABLE __temp__log AS SELECT id, owner_id, origin_place_id, origin_playable_entity_id, unplayable_entity_origin_id, destination_playable_entity_id, destination_unplayable_entity_id, destination_place_id, origin_path_id, destination_path_id, datetime, type, value FROM log');
            $this->addSql('DROP TABLE log');
            $this->addSql('CREATE TABLE log (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, owner_id INTEGER NOT NULL, origin_place_id INTEGER NOT NULL, origin_playable_entity_id INTEGER DEFAULT NULL, unplayable_entity_origin_id INTEGER DEFAULT NULL, destination_playable_entity_id INTEGER DEFAULT NULL, destination_unplayable_entity_id INTEGER DEFAULT NULL, destination_place_id INTEGER DEFAULT NULL, origin_path_id INTEGER DEFAULT NULL, destination_path_id INTEGER DEFAULT NULL, datetime DATETIME NOT NULL --(DC2Type:datetime_immutable)
            , type VARCHAR(255) NOT NULL, value INTEGER DEFAULT NULL, CONSTRAINT FK_8F3F68C57E3C61F9 FOREIGN KEY (owner_id) REFERENCES playable_entity (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_8F3F68C53E10C8E9 FOREIGN KEY (origin_place_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_8F3F68C5A30FFC4C FOREIGN KEY (origin_playable_entity_id) REFERENCES playable_entity (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_8F3F68C54CCA4D7D FOREIGN KEY (unplayable_entity_origin_id) REFERENCES unplayable_entity (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_8F3F68C569F6B503 FOREIGN KEY (destination_playable_entity_id) REFERENCES playable_entity (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_8F3F68C59A280F8B FOREIGN KEY (destination_unplayable_entity_id) REFERENCES unplayable_entity (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_8F3F68C553166228 FOREIGN KEY (destination_place_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_8F3F68C56C1B4306 FOREIGN KEY (origin_path_id) REFERENCES path (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_8F3F68C5B7556913 FOREIGN KEY (destination_path_id) REFERENCES path (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
            $this->addSql('INSERT INTO log (id, owner_id, origin_place_id, origin_playable_entity_id, unplayable_entity_origin_id, destination_playable_entity_id, destination_unplayable_entity_id, destination_place_id, origin_path_id, destination_path_id, datetime, type, value) SELECT id, owner_id, origin_place_id, origin_playable_entity_id, unplayable_entity_origin_id, destination_playable_entity_id, destination_unplayable_entity_id, destination_place_id, origin_path_id, destination_path_id, datetime, type, value FROM __temp__log');
            $this->addSql('DROP TABLE __temp__log');
            $this->addSql('CREATE INDEX IDX_8F3F68C553166228 ON log (destination_place_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C57E3C61F9 ON log (owner_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C53E10C8E9 ON log (origin_place_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C5A30FFC4C ON log (origin_playable_entity_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C54CCA4D7D ON log (unplayable_entity_origin_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C569F6B503 ON log (destination_playable_entity_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C59A280F8B ON log (destination_unplayable_entity_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C56C1B4306 ON log (origin_path_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C5B7556913 ON log (destination_path_id)');
            $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, 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_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, cost, type 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, cost INTEGER DEFAULT NULL, type VARCHAR(255) DEFAULT 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, cost, type) SELECT id, origin_id, destination_id, name, position, cost, type 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('DROP INDEX IDX_63110882DA6A219');
            $this->addSql('CREATE TEMPORARY TABLE __temp__place_description AS SELECT id, place_id, text, language, datetime FROM place_description');
            $this->addSql('DROP TABLE place_description');
            $this->addSql('CREATE TABLE place_description (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, place_id INTEGER NOT NULL, text CLOB NOT NULL, language VARCHAR(10) NOT NULL, datetime DATETIME NOT NULL --(DC2Type:datetime_immutable)
            , CONSTRAINT FK_63110882DA6A219 FOREIGN KEY (place_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
            $this->addSql('INSERT INTO place_description (id, place_id, text, language, datetime) SELECT id, place_id, text, language, datetime FROM __temp__place_description');
            $this->addSql('DROP TABLE __temp__place_description');
            $this->addSql('CREATE INDEX IDX_63110882DA6A219 ON place_description (place_id)');
            $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, race 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, 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, race) 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, race 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_15659A3F31C1B00');
            $this->addSql('CREATE TEMPORARY TABLE __temp__playable_entity_description AS SELECT id, playable_entity_id, text, language, datetime FROM playable_entity_description');
            $this->addSql('DROP TABLE playable_entity_description');
            $this->addSql('CREATE TABLE playable_entity_description (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, playable_entity_id INTEGER DEFAULT NULL, text CLOB NOT NULL, language VARCHAR(10) NOT NULL, datetime DATETIME NOT NULL --(DC2Type:datetime_immutable)
            , CONSTRAINT FK_15659A3F31C1B00 FOREIGN KEY (playable_entity_id) REFERENCES playable_entity (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
            $this->addSql('INSERT INTO playable_entity_description (id, playable_entity_id, text, language, datetime) SELECT id, playable_entity_id, text, language, datetime FROM __temp__playable_entity_description');
            $this->addSql('DROP TABLE __temp__playable_entity_description');
            $this->addSql('CREATE INDEX IDX_15659A3F31C1B00 ON playable_entity_description (playable_entity_id)');
            $this->addSql('DROP INDEX IDX_446A51C4537A1329');
            $this->addSql('DROP INDEX IDX_446A51C4E92F8F78');
            $this->addSql('CREATE TEMPORARY TABLE __temp__postman AS SELECT id, message_id, recipient_id, read FROM postman');
            $this->addSql('DROP TABLE postman');
            $this->addSql('CREATE TABLE postman (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, message_id INTEGER NOT NULL, recipient_id INTEGER NOT NULL, read BOOLEAN NOT NULL, CONSTRAINT FK_446A51C4537A1329 FOREIGN KEY (message_id) REFERENCES message (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_446A51C4E92F8F78 FOREIGN KEY (recipient_id) REFERENCES playable_entity (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
            $this->addSql('INSERT INTO postman (id, message_id, recipient_id, read) SELECT id, message_id, recipient_id, read FROM __temp__postman');
            $this->addSql('DROP TABLE __temp__postman');
            $this->addSql('CREATE INDEX IDX_446A51C4537A1329 ON postman (message_id)');
            $this->addSql('CREATE INDEX IDX_446A51C4E92F8F78 ON postman (recipient_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, description 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, description) SELECT id, place_id, name, hp, hp_max, ap, ap_max, armor_class, description FROM __temp__unplayable_entity');
            $this->addSql('DROP TABLE __temp__unplayable_entity');
            $this->addSql('CREATE INDEX IDX_86A7E937DA6A219 ON unplayable_entity (place_id)');
            $this->addSql('DROP INDEX UNIQ_8D93D649E7927C74');
            $this->addSql('DROP INDEX UNIQ_8D93D6491136BE75');
            $this->addSql('CREATE TEMPORARY TABLE __temp__user AS SELECT id, character_id, email, roles, password, nickname FROM user');
            $this->addSql('DROP TABLE user');
            $this->addSql('CREATE TABLE user (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, character_id INTEGER DEFAULT NULL, email VARCHAR(180) NOT NULL, roles CLOB NOT NULL --(DC2Type:json)
            , password VARCHAR(255) NOT NULL, nickname VARCHAR(255) NOT NULL, CONSTRAINT FK_8D93D6491136BE75 FOREIGN KEY (character_id) REFERENCES playable_entity (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
            $this->addSql('INSERT INTO user (id, character_id, email, roles, password, nickname) SELECT id, character_id, email, roles, password, nickname FROM __temp__user');
            $this->addSql('DROP TABLE __temp__user');
            $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E7927C74 ON user (email)');
            $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D6491136BE75 ON user (character_id)');
        }
    
        public function down(Schema $schema): void
        {
            // this down() migration is auto-generated, please modify it to your needs
            $this->addSql('DROP TABLE item');
            $this->addSql('DROP INDEX IDX_4966C724DA6A219');
            $this->addSql('CREATE TEMPORARY TABLE __temp__artifact_entity AS SELECT id, place_id, name, hp_max, hp, description 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)
            )');
            $this->addSql('INSERT INTO artifact_entity (id, place_id, name, hp_max, hp, description) SELECT id, place_id, name, hp_max, hp, description 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_582BD22A796FAEA1');
            $this->addSql('DROP INDEX IDX_582BD22ADA6A219');
            $this->addSql('CREATE TEMPORARY TABLE __temp__artifact_entity_place AS SELECT artifact_entity_id, place_id FROM artifact_entity_place');
            $this->addSql('DROP TABLE artifact_entity_place');
            $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('INSERT INTO artifact_entity_place (artifact_entity_id, place_id) SELECT artifact_entity_id, place_id FROM __temp__artifact_entity_place');
            $this->addSql('DROP TABLE __temp__artifact_entity_place');
            $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('DROP INDEX IDX_8F3F68C57E3C61F9');
            $this->addSql('DROP INDEX IDX_8F3F68C53E10C8E9');
            $this->addSql('DROP INDEX IDX_8F3F68C5A30FFC4C');
            $this->addSql('DROP INDEX IDX_8F3F68C54CCA4D7D');
            $this->addSql('DROP INDEX IDX_8F3F68C569F6B503');
            $this->addSql('DROP INDEX IDX_8F3F68C59A280F8B');
            $this->addSql('DROP INDEX IDX_8F3F68C553166228');
            $this->addSql('DROP INDEX IDX_8F3F68C56C1B4306');
            $this->addSql('DROP INDEX IDX_8F3F68C5B7556913');
            $this->addSql('CREATE TEMPORARY TABLE __temp__log AS SELECT id, owner_id, origin_place_id, origin_playable_entity_id, unplayable_entity_origin_id, destination_playable_entity_id, destination_unplayable_entity_id, destination_place_id, origin_path_id, destination_path_id, datetime, type, value FROM log');
            $this->addSql('DROP TABLE log');
            $this->addSql('CREATE TABLE log (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, owner_id INTEGER NOT NULL, origin_place_id INTEGER NOT NULL, origin_playable_entity_id INTEGER DEFAULT NULL, unplayable_entity_origin_id INTEGER DEFAULT NULL, destination_playable_entity_id INTEGER DEFAULT NULL, destination_unplayable_entity_id INTEGER DEFAULT NULL, destination_place_id INTEGER DEFAULT NULL, origin_path_id INTEGER DEFAULT NULL, destination_path_id INTEGER DEFAULT NULL, datetime DATETIME NOT NULL --(DC2Type:datetime_immutable)
            , type VARCHAR(255) NOT NULL, value INTEGER DEFAULT NULL)');
            $this->addSql('INSERT INTO log (id, owner_id, origin_place_id, origin_playable_entity_id, unplayable_entity_origin_id, destination_playable_entity_id, destination_unplayable_entity_id, destination_place_id, origin_path_id, destination_path_id, datetime, type, value) SELECT id, owner_id, origin_place_id, origin_playable_entity_id, unplayable_entity_origin_id, destination_playable_entity_id, destination_unplayable_entity_id, destination_place_id, origin_path_id, destination_path_id, datetime, type, value FROM __temp__log');
            $this->addSql('DROP TABLE __temp__log');
            $this->addSql('CREATE INDEX IDX_8F3F68C57E3C61F9 ON log (owner_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C53E10C8E9 ON log (origin_place_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C5A30FFC4C ON log (origin_playable_entity_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C54CCA4D7D ON log (unplayable_entity_origin_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C569F6B503 ON log (destination_playable_entity_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C59A280F8B ON log (destination_unplayable_entity_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C553166228 ON log (destination_place_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C56C1B4306 ON log (origin_path_id)');
            $this->addSql('CREATE INDEX IDX_8F3F68C5B7556913 ON log (destination_path_id)');
            $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, cost, type 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, cost INTEGER DEFAULT NULL, type VARCHAR(255) DEFAULT NULL)');
            $this->addSql('INSERT INTO path (id, origin_id, destination_id, name, position, cost, type) SELECT id, origin_id, destination_id, name, position, cost, type 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('DROP INDEX IDX_63110882DA6A219');
            $this->addSql('CREATE TEMPORARY TABLE __temp__place_description AS SELECT id, place_id, text, language, datetime FROM place_description');
            $this->addSql('DROP TABLE place_description');
            $this->addSql('CREATE TABLE place_description (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, place_id INTEGER NOT NULL, text CLOB NOT NULL, language VARCHAR(10) NOT NULL, datetime DATETIME NOT NULL --(DC2Type:datetime_immutable)
            )');
            $this->addSql('INSERT INTO place_description (id, place_id, text, language, datetime) SELECT id, place_id, text, language, datetime FROM __temp__place_description');
            $this->addSql('DROP TABLE __temp__place_description');
            $this->addSql('CREATE INDEX IDX_63110882DA6A219 ON place_description (place_id)');
            $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, race 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)');
            $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, race) 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, race 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_15659A3F31C1B00');
            $this->addSql('CREATE TEMPORARY TABLE __temp__playable_entity_description AS SELECT id, playable_entity_id, text, language, datetime FROM playable_entity_description');
            $this->addSql('DROP TABLE playable_entity_description');
            $this->addSql('CREATE TABLE playable_entity_description (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, playable_entity_id INTEGER DEFAULT NULL, text CLOB NOT NULL, language VARCHAR(10) NOT NULL, datetime DATETIME NOT NULL --(DC2Type:datetime_immutable)
            )');
            $this->addSql('INSERT INTO playable_entity_description (id, playable_entity_id, text, language, datetime) SELECT id, playable_entity_id, text, language, datetime FROM __temp__playable_entity_description');
            $this->addSql('DROP TABLE __temp__playable_entity_description');
            $this->addSql('CREATE INDEX IDX_15659A3F31C1B00 ON playable_entity_description (playable_entity_id)');
            $this->addSql('DROP INDEX IDX_446A51C4537A1329');
            $this->addSql('DROP INDEX IDX_446A51C4E92F8F78');
            $this->addSql('CREATE TEMPORARY TABLE __temp__postman AS SELECT id, message_id, recipient_id, read FROM postman');
            $this->addSql('DROP TABLE postman');
            $this->addSql('CREATE TABLE postman (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, message_id INTEGER NOT NULL, recipient_id INTEGER NOT NULL, read BOOLEAN NOT NULL)');
            $this->addSql('INSERT INTO postman (id, message_id, recipient_id, read) SELECT id, message_id, recipient_id, read FROM __temp__postman');
            $this->addSql('DROP TABLE __temp__postman');
            $this->addSql('CREATE INDEX IDX_446A51C4537A1329 ON postman (message_id)');
            $this->addSql('CREATE INDEX IDX_446A51C4E92F8F78 ON postman (recipient_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, description 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)
            )');
            $this->addSql('INSERT INTO unplayable_entity (id, place_id, name, hp, hp_max, ap, ap_max, armor_class, description) SELECT id, place_id, name, hp, hp_max, ap, ap_max, armor_class, description FROM __temp__unplayable_entity');
            $this->addSql('DROP TABLE __temp__unplayable_entity');
            $this->addSql('CREATE INDEX IDX_86A7E937DA6A219 ON unplayable_entity (place_id)');
            $this->addSql('DROP INDEX UNIQ_8D93D649E7927C74');
            $this->addSql('DROP INDEX UNIQ_8D93D6491136BE75');
            $this->addSql('CREATE TEMPORARY TABLE __temp__user AS SELECT id, character_id, nickname, email, roles, password FROM user');
            $this->addSql('DROP TABLE user');
            $this->addSql('CREATE TABLE user (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, character_id INTEGER DEFAULT NULL, nickname VARCHAR(255) NOT NULL, email VARCHAR(180) NOT NULL, roles CLOB NOT NULL --(DC2Type:json)
            , password VARCHAR(255) NOT NULL)');
            $this->addSql('INSERT INTO user (id, character_id, nickname, email, roles, password) SELECT id, character_id, nickname, email, roles, password FROM __temp__user');
            $this->addSql('DROP TABLE __temp__user');
            $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E7927C74 ON user (email)');
            $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D6491136BE75 ON user (character_id)');
        }
    }