Skip to content

Commit

Permalink
add competition_id index for registrations (#9678)
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnIckler authored Jul 16, 2024
1 parent e093d55 commit f2f1fff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

class AddMoreIndexesToRegistrations < ActiveRecord::Migration[7.1]
def change
add_index :registrations, :competition_id
add_index :registration_payments, :registration_id
end
end
4 changes: 3 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2024_06_05_145605) do
ActiveRecord::Schema[7.1].define(version: 2024_07_16_145605) do
create_table "Competitions", id: { type: :string, limit: 32, default: "" }, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.string "name", limit: 50, default: "", null: false
t.string "cityName", limit: 50, default: "", null: false
Expand Down Expand Up @@ -977,6 +977,7 @@
t.integer "user_id"
t.index ["receipt_type", "receipt_id"], name: "index_registration_payments_on_receipt"
t.index ["refunded_registration_payment_id"], name: "idx_reg_payments_on_refunded_registration_payment_id"
t.index ["registration_id"], name: "index_registration_payments_on_registration_id"
t.index ["stripe_charge_id"], name: "index_registration_payments_on_stripe_charge_id"
end

Expand All @@ -996,6 +997,7 @@
t.boolean "is_competing", default: true
t.text "administrative_notes"
t.index ["competition_id", "user_id"], name: "index_registrations_on_competition_id_and_user_id", unique: true
t.index ["competition_id"], name: "index_registrations_on_competition_id"
t.index ["user_id"], name: "index_registrations_on_user_id"
end

Expand Down

0 comments on commit f2f1fff

Please sign in to comment.