migrations/Version20231105223821.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 Version20231105223821 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('CREATE TABLE building_family (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE building ADD family_id INT DEFAULT NULL, ADD bonus INT DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE building ADD CONSTRAINT FK_E16F61D4C35E566A FOREIGN KEY (family_id) REFERENCES building_family (id)');
  21.         $this->addSql('CREATE INDEX IDX_E16F61D4C35E566A ON building (family_id)');
  22.         $this->addSql("INSERT INTO `building_family` (`id`, `name`, `description`) VALUES(1, 'chest', 'Amélioration du stockage')");
  23.         $this->addSql("INSERT INTO `building_family` (`id`, `name`, `description`) VALUES(2, 'defense', 'Amélioration des défenses du camp')");
  24.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(1, NULL, 1, 'Petit coffre', 'Augment de 2 l''espace de stockage du camp.', 5, 1, 1)");
  25.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(2, 1, 1, 'Atelier', 'Un petit atelier de fortune permettant de transformer vos ressources au prix de quelques heures de travail.', 12, NULL, NULL)");
  26.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(3, 2, 1, 'Petit coffre amélioré', 'Un peu de place en plus, ce n''est jamais de refus.', 5, 1, 1)");
  27.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(4, NULL, 1, 'Lit de fortune', 'Creuser un trou, y mettre une planche, voilà de quoi se reposer.', 5, NULL, NULL)");
  28.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(5, 4, 1, 'Sommier', 'Ce n''est pas aussi agréable qu''une capsule de sommeil, mais c''est déjà ça.', 5, NULL, NULL)");
  29.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(6, NULL, 1, 'Cuve en bois', 'Permet de récolter un peu d''eau, lorsqu''elle ne s''est pas percée dans la nuit.', 5, NULL, NULL)");
  30.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(7, NULL, 1, 'Elagage', 'Voilà un beau jardin !', 5, NULL, NULL)");
  31.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(8, 7, 1, 'Trou de loup', 'Un trou, un bout de bois pointu au fond. Un piège de fortune qui a fait ses preuves, au moyen-âge.', 5, 2, 1)");
  32.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(9, 7, 1, 'Pieux en bois', 'Ca apporte un côté sympa, ce champ de gros cure-dents.', 5, 2, 1)");
  33.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(10, NULL, 1, 'Fondations en bois', 'Une base presque solide, pour un campement presque résistant.', 10, NULL, NULL)");
  34.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(11, 10, 1, 'Porte en bois', 'A présent, vos invités peuvent frapper avant d''entrer !', 5, 2, 1)");
  35.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(12, 10, 1, 'Palissade', 'Il est fort probable que le premier coup de vent dans la région la fasse tomber.', 8, 2, 1)");
  36.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(13, 10, 1, 'Cloison en bois', 'Les prémisses de grandes choses.', 8, 2, 1)");
  37.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(14, 13, 1, 'Renforcement des murs', 'Il est temps de passer à un logement plus adéquat à de la survie.', 8, 2, 1)");
  38.         $this->addSql("INSERT INTO building (id, previous_requierment_id, tier, name, description, action_point_cost, family_id, bonus) VALUES(15, 14, 1, 'Amélioration du campement', 'Il faut améliorer ce campement pour pouvoir améliorer l''équipement.', 15, NULL, NULL)");
  39.         $this->addSql("INSERT INTO `building_item` (`id`, `building_id`, `item_id`, `quantity`) VALUES(1, 1, 1, 3)");
  40.         $this->addSql("INSERT INTO `monster` (`id`, `name`, `description`, `power`) VALUES(1, 'Traqueur', 'Une bestiole de la taille d''un gros chien.', 1)");
  41.     }
  42.     public function down(Schema $schema): void
  43.     {
  44.         // this down() migration is auto-generated, please modify it to your needs
  45.         $this->addSql('ALTER TABLE building DROP FOREIGN KEY FK_E16F61D4C35E566A');
  46.         $this->addSql('DROP TABLE building_family');
  47.         $this->addSql('DROP INDEX IDX_E16F61D4C35E566A ON building');
  48.         $this->addSql('ALTER TABLE building DROP family_id, DROP bonus');
  49.     }
  50. }