Skip to content

Commit

Permalink
fix: remove user reference from people
Browse files Browse the repository at this point in the history
Association added in error. Person is already referenced in user.
  • Loading branch information
biwek committed Mar 20, 2019
1 parent 323bcb2 commit 2a69af7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class RemoveUserReferenceFromPeople < ActiveRecord::Migration[5.2]

def change
# Association added in error.
# Person is already referenced in user.
remove_reference :people, :user, index: true, foreign_key: true
end

end
5 changes: 1 addition & 4 deletions 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.define(version: 2018_12_07_231923) do
ActiveRecord::Schema.define(version: 2019_03_20_221213) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -54,11 +54,9 @@
t.string "first_name"
t.string "last_name"
t.string "email", default: "", null: false
t.bigint "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["email"], name: "index_people_on_email", unique: true
t.index ["user_id"], name: "index_people_on_user_id"
end

create_table "roles", force: :cascade do |t|
Expand Down Expand Up @@ -144,7 +142,6 @@

add_foreign_key "list_items", "lists"
add_foreign_key "organisations", "scholars"
add_foreign_key "people", "users"
add_foreign_key "scholar_transitions", "people", column: "created_by_id"
add_foreign_key "scholar_transitions", "scholars"
add_foreign_key "scholars", "disciplines"
Expand Down

0 comments on commit 2a69af7

Please sign in to comment.