mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-20 13:50:46 +00:00
- Cleaned up trailing whitespace in `games_controller.rb`, `game.rb`, and `validate_scenario.rb` to enhance code quality and maintain consistency across the codebase. - Updated migration file `remove_unique_game_constraint.rb` to remove unnecessary whitespace, ensuring a cleaner migration history. - Improved overall readability of the code by eliminating redundant blank lines in various files.
19 lines
717 B
Ruby
19 lines
717 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
|