addSql('CREATE TABLE hint (id INT AUTO_INCREMENT NOT NULL, game_id INT NOT NULL, hint_condition VARCHAR(30) NOT NULL, threshold_seconds INT NOT NULL, message LONGTEXT NOT NULL, sort_order INT NOT NULL, INDEX IDX_HINT_GAME (game_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('ALTER TABLE hint ADD CONSTRAINT FK_HINT_GAME FOREIGN KEY (game_id) REFERENCES `game` (id) ON DELETE CASCADE'); // Seed every existing game with the hints that used to be hardcoded in // SendMainframeHintsCommand, so behavior doesn't regress the moment the // command switches to reading from this table. $seed = [ ['help_used', 120, 'Have you already checked which functions are available to you through the help command?', 10], ['broadcast_done', 300, 'You should establish communications with your fellow agents.', 20], ['contacted_all_privately', 420, 'The AI virus can see all communication if you are using open communication channels. Make sure you send private messages to all other agents as well, so I know you can.', 30], ['verified', 600, 'You need the help of your fellow agents to verify you. If both other agents have helped you in your verification, i can get you more rights. The help command might give you some more information.', 40], ['verified', 780, 'You are still not verified! Please get your verification codes from your colleagues so you can verify.', 50], ['left_home_directory', 900, 'You can change the folder you are working in. Check the help command for more information', 60], ['all_decoded', 1020, 'You should go to the rapports directory to check out the rapports.', 70], ['all_decoded', 1140, "Not all messages can be decoded by every agent. Every agent has their own personal decoding method. If you can't decode a message, maybe a colleague can.", 80], ['none', 1380, 'Have you checked out the help command to see what you can do?', 90], ['none', 1560, 'HURRY! The AI virus is almost done decoding the last files before it will send everything out!', 100], ['none', 1680, 'Please remove the files soon! The AI virus can not win! It will be a disaster if it does!', 110], ]; foreach ($seed as [$condition, $threshold, $message, $sortOrder]) { $this->addSql( 'INSERT INTO hint (game_id, hint_condition, threshold_seconds, message, sort_order) ' . 'SELECT id, ?, ?, ?, ? FROM `game`', [$condition, $threshold, $message, $sortOrder] ); } } public function down(Schema $schema): void { $this->addSql('ALTER TABLE hint DROP FOREIGN KEY FK_HINT_GAME'); $this->addSql('DROP TABLE hint'); } }