Files
BreakEscape/db/migrate/20251128000001_remove_unique_game_constraint.rb
Z. Cliffe Schreuders 289c0ce1c7 Add lab workstation functionality and integrate into gameplay
- Introduced a lab workstation popup in the game interface for accessing lab sheets via an iframe.
- Implemented JavaScript functions to create, open, and close the lab workstation, enhancing user interaction.
- Updated CSS styles for the lab workstation popup to ensure a seamless visual experience.
- Enhanced interaction handling to allow players to open lab workstations from inventory items.
- Added new scenario files for the Linux Fundamentals and Security Lab, including detailed instructions and objectives for players.
- Updated scenario schema to include the new lab workstation type, ensuring proper integration into the game mechanics.
2025-12-04 02:10:35 +00:00

23 lines
721 B
Ruby

# frozen_string_literal: true
# Remove unique constraint on games to allow multiple games per player+mission
# This is needed for VM/CTF flag integration where each VM set gets its own game instance
class RemoveUniqueGameConstraint < ActiveRecord::Migration[7.0]
def change
# Remove the unique index
remove_index :break_escape_games,
name: 'index_games_on_player_and_mission',
if_exists: true
# Add non-unique index for performance
# This maintains query performance without enforcing uniqueness
add_index :break_escape_games,
[:player_type, :player_id, :mission_id],
name: 'index_games_on_player_and_mission_non_unique'
end
end