From c201200e9bd9fbc021824fb20c70767c60b2d48e Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Fri, 2 Dec 2016 23:17:01 -0500 Subject: [PATCH] correct schema and add index for photos_seeds --- db/migrate/20161201154922_add_photos_seeds_table.rb | 1 + db/schema.rb | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/db/migrate/20161201154922_add_photos_seeds_table.rb b/db/migrate/20161201154922_add_photos_seeds_table.rb index 12605ae4c..31693d225 100644 --- a/db/migrate/20161201154922_add_photos_seeds_table.rb +++ b/db/migrate/20161201154922_add_photos_seeds_table.rb @@ -4,5 +4,6 @@ class AddPhotosSeedsTable < ActiveRecord::Migration t.integer :photo_id t.integer :seed_id end + add_index(:photos_seeds, [:seed_id, :photo_id]) end end diff --git a/db/schema.rb b/db/schema.rb index 4901b8499..429fabf04 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -355,14 +355,6 @@ ActiveRecord::Schema.define(version: 20161201154922) do t.integer "product_id" end - create_table "photo_mappings", force: :cascade do |t| - t.integer "photo_id" - t.integer "object_id" - t.string "object_type" - end - - add_index "photo_mappings", ["object_id", "photo_id"], name: "index_photo_mappings_on_object_id_and_photo_id", using: :btree - create_table "photos", force: :cascade do |t| t.integer "owner_id", null: false t.string "thumbnail_url", null: false @@ -386,6 +378,8 @@ ActiveRecord::Schema.define(version: 20161201154922) do t.integer "seed_id" end + add_index "photos_seeds", ["seed_id", "photo_id"], name: "index_photos_seeds_on_seed_id_and_photo_id", using: :btree + create_table "plant_parts", force: :cascade do |t| t.string "name" t.datetime "created_at"