diff --git a/db/migrate/20241217161720_create_unique_index_on_people_user_id.rb b/db/migrate/20241217161720_create_unique_index_on_people_user_id.rb new file mode 100644 index 000000000..de2884150 --- /dev/null +++ b/db/migrate/20241217161720_create_unique_index_on_people_user_id.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index fd84a7870..c1c1e91a9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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" @@ -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| diff --git a/erd.pdf b/erd.pdf index a5e3f772f..e6219763e 100644 Binary files a/erd.pdf and b/erd.pdf differ