1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Add index to category photo link table

This commit is contained in:
Daniel Barber 2015-08-27 21:59:35 +01:00
parent a988009aa2
commit 4b556719be
2 changed files with 12 additions and 6 deletions

View File

@ -0,0 +1,5 @@
class AddIndexToCategoriesPhotos < ActiveRecord::Migration
def change
add_index :categories_photos, [:category_id, :photo_id], unique: true
end
end

View File

@ -11,18 +11,18 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140308082639) do
ActiveRecord::Schema.define(version: 20150827205816) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "admin_users", force: true do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "email", default: "", null: false
t.string "encrypted_password", limit: 128, default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0
t.integer "sign_in_count", default: 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
@ -30,8 +30,7 @@ ActiveRecord::Schema.define(version: 20140308082639) do
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
t.integer "failed_attempts", default: 0
t.integer "failed_attempts", default: 0
t.string "unlock_token"
t.datetime "locked_at"
t.datetime "created_at"
@ -59,6 +58,8 @@ ActiveRecord::Schema.define(version: 20140308082639) do
t.integer "photo_id"
end
add_index "categories_photos", ["category_id", "photo_id"], name: "index_categories_photos_on_category_id_and_photo_id", unique: true, using: :btree
create_table "pages", force: true do |t|
t.string "name"
t.string "title"