migrations/Version20220226113359.php line 1

  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220226113359 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('DROP INDEX IDX_B6BD307FD1741030');
  19.         $this->addSql('DROP INDEX IDX_B6BD307F2239FAB1');
  20.         $this->addSql('CREATE TEMPORARY TABLE __temp__message AS SELECT id, place_origin_id, playable_entity_origin_id, date_time, content FROM message');
  21.         $this->addSql('DROP TABLE message');
  22.         $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)
  23.         , 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)');
  24.         $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');
  25.         $this->addSql('DROP TABLE __temp__message');
  26.         $this->addSql('CREATE INDEX IDX_B6BD307FD1741030 ON message (playable_entity_origin_id)');
  27.         $this->addSql('CREATE INDEX IDX_B6BD307F2239FAB1 ON message (place_origin_id)');
  28.         $this->addSql('DROP INDEX IDX_B548B0F816C6140');
  29.         $this->addSql('DROP INDEX IDX_B548B0F56A273CC');
  30.         $this->addSql('CREATE TEMPORARY TABLE __temp__path AS SELECT id, origin_id, destination_id, name, position FROM path');
  31.         $this->addSql('DROP TABLE path');
  32.         $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)');
  33.         $this->addSql('INSERT INTO path (id, origin_id, destination_id, name, position) SELECT id, origin_id, destination_id, name, position FROM __temp__path');
  34.         $this->addSql('DROP TABLE __temp__path');
  35.         $this->addSql('CREATE INDEX IDX_B548B0F816C6140 ON path (destination_id)');
  36.         $this->addSql('CREATE INDEX IDX_B548B0F56A273CC ON path (origin_id)');
  37.         $this->addSql('DROP INDEX IDX_114242BEDA6A219');
  38.         $this->addSql('DROP INDEX IDX_114242BE99E6F5DF');
  39.         $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');
  40.         $this->addSql('DROP TABLE playable_entity');
  41.         $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)
  42.         , 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)
  43.         , abilities CLOB DEFAULT NULL --(DC2Type:array)
  44.         , known_magicskills CLOB DEFAULT NULL --(DC2Type:array)
  45.         , known_attackskills CLOB DEFAULT NULL --(DC2Type:array)
  46.         , known_craftskills CLOB DEFAULT NULL --(DC2Type:array)
  47.         , 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)');
  48.         $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');
  49.         $this->addSql('DROP TABLE __temp__playable_entity');
  50.         $this->addSql('CREATE INDEX IDX_114242BEDA6A219 ON playable_entity (place_id)');
  51.         $this->addSql('CREATE INDEX IDX_114242BE99E6F5DF ON playable_entity (player_id)');
  52.         $this->addSql('DROP INDEX IDX_86A7E937DA6A219');
  53.         $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');
  54.         $this->addSql('DROP TABLE unplayable_entity');
  55.         $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, CONSTRAINT FK_86A7E937DA6A219 FOREIGN KEY (place_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
  56.         $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');
  57.         $this->addSql('DROP TABLE __temp__unplayable_entity');
  58.         $this->addSql('CREATE INDEX IDX_86A7E937DA6A219 ON unplayable_entity (place_id)');
  59.     }
  60.     public function down(Schema $schema): void
  61.     {
  62.         // this down() migration is auto-generated, please modify it to your needs
  63.         $this->addSql('DROP INDEX IDX_B6BD307F2239FAB1');
  64.         $this->addSql('DROP INDEX IDX_B6BD307FD1741030');
  65.         $this->addSql('CREATE TEMPORARY TABLE __temp__message AS SELECT id, place_origin_id, playable_entity_origin_id, date_time, content FROM message');
  66.         $this->addSql('DROP TABLE message');
  67.         $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)
  68.         , content CLOB NOT NULL)');
  69.         $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');
  70.         $this->addSql('DROP TABLE __temp__message');
  71.         $this->addSql('CREATE INDEX IDX_B6BD307F2239FAB1 ON message (place_origin_id)');
  72.         $this->addSql('CREATE INDEX IDX_B6BD307FD1741030 ON message (playable_entity_origin_id)');
  73.         $this->addSql('DROP INDEX IDX_B548B0F56A273CC');
  74.         $this->addSql('DROP INDEX IDX_B548B0F816C6140');
  75.         $this->addSql('CREATE TEMPORARY TABLE __temp__path AS SELECT id, origin_id, destination_id, name, position FROM path');
  76.         $this->addSql('DROP TABLE path');
  77.         $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)');
  78.         $this->addSql('INSERT INTO path (id, origin_id, destination_id, name, position) SELECT id, origin_id, destination_id, name, position FROM __temp__path');
  79.         $this->addSql('DROP TABLE __temp__path');
  80.         $this->addSql('CREATE INDEX IDX_B548B0F56A273CC ON path (origin_id)');
  81.         $this->addSql('CREATE INDEX IDX_B548B0F816C6140 ON path (destination_id)');
  82.         $this->addSql('DROP INDEX IDX_114242BE99E6F5DF');
  83.         $this->addSql('DROP INDEX IDX_114242BEDA6A219');
  84.         $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');
  85.         $this->addSql('DROP TABLE playable_entity');
  86.         $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)
  87.         , 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)
  88.         , abilities CLOB DEFAULT NULL --(DC2Type:array)
  89.         , known_magicskills CLOB DEFAULT NULL --(DC2Type:array)
  90.         , known_attackskills CLOB DEFAULT NULL --(DC2Type:array)
  91.         , known_craftskills CLOB DEFAULT NULL --(DC2Type:array)
  92.         )');
  93.         $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');
  94.         $this->addSql('DROP TABLE __temp__playable_entity');
  95.         $this->addSql('CREATE INDEX IDX_114242BE99E6F5DF ON playable_entity (player_id)');
  96.         $this->addSql('CREATE INDEX IDX_114242BEDA6A219 ON playable_entity (place_id)');
  97.         $this->addSql('DROP INDEX IDX_86A7E937DA6A219');
  98.         $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');
  99.         $this->addSql('DROP TABLE unplayable_entity');
  100.         $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)');
  101.         $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');
  102.         $this->addSql('DROP TABLE __temp__unplayable_entity');
  103.         $this->addSql('CREATE INDEX IDX_86A7E937DA6A219 ON unplayable_entity (place_id)');
  104.     }
  105. }