OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add indices for meeting participants
Klaus Zanders2dad2eab9fce
diff --git a/modules/meeting/app/models/meeting_participant.rb b/modules/meeting/app/models/meeting_participant.rbindex cefe3153675..65c47752aa5 100644--- a/modules/meeting/app/models/meeting_participant.rb+++ b/modules/meeting/app/models/meeting_participant.rb@@ -1,4 +1,5 @@# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbH@@ -31,6 +32,8 @@ class MeetingParticipant < ApplicationRecordbelongs_to :meetingbelongs_to :user+ validates :user, presence: true, uniqueness: { scope: :meeting_id }+scope :invited, -> { where(invited: true) }scope :attended, -> { where(attended: true) }diff --git a/modules/meeting/db/migrate/20250821092618_add_indices_to_meeting_participants.rb b/modules/meeting/db/migrate/20250821092618_add_indices_to_meeting_participants.rbnew file mode 100644index 00000000000..e8545c62919--- /dev/null+++ b/modules/meeting/db/migrate/20250821092618_add_indices_to_meeting_participants.rb@@ -0,0 +1,12 @@+# frozen_string_literal: true++class AddIndicesToMeetingParticipants < ActiveRecord::Migration[8.0]+ disable_ddl_transaction!++ def change+ add_index :meeting_participants, :meeting_id, algorithm: :concurrently+ add_index :meeting_participants, :user_id, algorithm: :concurrently++ add_index :meeting_participants, %i[meeting_id user_id], unique: true, algorithm: :concurrently+ end+end