Skip to content

Commit

Permalink
Merge pull request AlchemyCMS#2466 from sascha-karnatz/alchemy-pictur…
Browse files Browse the repository at this point in the history
…e-indexes

Add indexes to pictures table
  • Loading branch information
tvdeyen committed May 9, 2023
2 parents 25bac6b + 309284c commit a035302
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions db/migrate/20230505132743_add_indexes_to_alchemy_pictures.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddIndexesToAlchemyPictures < ActiveRecord::Migration[6.1]
def change
add_index :alchemy_pictures, :name, if_not_exists: true
add_index :alchemy_pictures, :image_file_name, if_not_exists: true
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddIndexesToAlchemyPictures < ActiveRecord::Migration[6.1]
def change
add_index :alchemy_pictures, :name, if_not_exists: true
add_index :alchemy_pictures, :image_file_name, if_not_exists: true
end
end
4 changes: 3 additions & 1 deletion spec/dummy/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.0].define(version: 2023_01_23_105660) do
ActiveRecord::Schema[7.0].define(version: 2023_05_05_132743) do
create_table "alchemy_attachments", force: :cascade do |t|
t.string "name"
t.string "file_name"
Expand Down Expand Up @@ -202,6 +202,8 @@
t.integer "image_file_size"
t.string "image_file_format"
t.index ["creator_id"], name: "index_alchemy_pictures_on_creator_id"
t.index ["image_file_name"], name: "index_alchemy_pictures_on_image_file_name"
t.index ["name"], name: "index_alchemy_pictures_on_name"
t.index ["updater_id"], name: "index_alchemy_pictures_on_updater_id"
end

Expand Down

0 comments on commit a035302

Please sign in to comment.