Skip to content

Commit

Permalink
Add index to backups on user_id column (#25647)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski authored Jun 30, 2023
1 parent 78ba12f commit c47cdf6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions db/migrate/20230630145300_add_index_backups_on_user_id.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

class AddIndexBackupsOnUserId < ActiveRecord::Migration[6.1]
disable_ddl_transaction!

def change
add_index :backups, :user_id, algorithm: :concurrently
end
end
3 changes: 2 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.define(version: 2023_06_05_085711) do
ActiveRecord::Schema.define(version: 2023_06_30_145300) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -273,6 +273,7 @@
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "dump_file_size"
t.index ["user_id"], name: "index_backups_on_user_id"
end

create_table "blocks", force: :cascade do |t|
Expand Down

0 comments on commit c47cdf6

Please sign in to comment.