From 4b75623b864917d9848644bc6f7db31d5674262c Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Wed, 28 Feb 2024 10:35:51 +0200 Subject: [PATCH] add index on blob checksum --- db/migrate/20240228083356_add_index_on_blobs_checksum.rb | 7 +++++++ db/schema.rb | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20240228083356_add_index_on_blobs_checksum.rb diff --git a/db/migrate/20240228083356_add_index_on_blobs_checksum.rb b/db/migrate/20240228083356_add_index_on_blobs_checksum.rb new file mode 100644 index 00000000..da4a054b --- /dev/null +++ b/db/migrate/20240228083356_add_index_on_blobs_checksum.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddIndexOnBlobsChecksum < ActiveRecord::Migration[7.1] + def change + add_index :active_storage_blobs, :checksum + end +end diff --git a/db/schema.rb b/db/schema.rb index 52f237ca..6f65f300 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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_02_28_074821) do +ActiveRecord::Schema[7.1].define(version: 2024_02_28_083356) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -75,6 +75,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_28_074821) do t.string "checksum" t.datetime "created_at", null: false t.string "uuid" + t.index ["checksum"], name: "index_active_storage_blobs_on_checksum" t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true t.index ["uuid"], name: "index_active_storage_blobs_on_uuid", unique: true end