Skip to content

Commit

Permalink
Add unique index on people.user_id
Browse files Browse the repository at this point in the history
  • Loading branch information
moveson committed Dec 17, 2024
1 parent b6a18dc commit 30f85c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class CreateUniqueIndexOnPeopleUserId < ActiveRecord::Migration[7.0]
def change
remove_index :people, :user_id
add_index :people, :user_id, unique: true
end
end
4 changes: 2 additions & 2 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[7.0].define(version: 2024_12_16_054507) do
ActiveRecord::Schema[7.0].define(version: 2024_12_17_161720) do
# These are extensions that must be enabled in order to support this database
enable_extension "fuzzystrmatch"
enable_extension "pg_trgm"
Expand Down Expand Up @@ -494,7 +494,7 @@
t.string "country_name"
t.index ["slug"], name: "index_people_on_slug", unique: true
t.index ["topic_resource_key"], name: "index_people_on_topic_resource_key", unique: true
t.index ["user_id"], name: "index_people_on_user_id"
t.index ["user_id"], name: "index_people_on_user_id", unique: true
end

create_table "projection_assessment_runs", force: :cascade do |t|
Expand Down
Binary file modified erd.pdf
Binary file not shown.

0 comments on commit 30f85c5

Please sign in to comment.