Add index to backups on user_id column (#25647)

This commit is contained in:
Matt Jankowski 2023-06-30 13:09:03 -04:00 committed by GitHub
parent 78ba12f0bf
commit c47cdf6e17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -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

View file

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -273,6 +273,7 @@ ActiveRecord::Schema.define(version: 2023_06_05_085711) do
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.bigint "dump_file_size" t.bigint "dump_file_size"
t.index ["user_id"], name: "index_backups_on_user_id"
end end
create_table "blocks", force: :cascade do |t| create_table "blocks", force: :cascade do |t|