Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into oveson/lottery-service-form-fin…
Browse files Browse the repository at this point in the history
…e-tuning
  • Loading branch information
moveson committed Dec 17, 2024
2 parents ed401bb + 7423a7a commit c087819
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/models/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Person < ApplicationRecord
validates :email, allow_blank: true, length: {maximum: 105},
format: {with: VALID_EMAIL_REGEX}
validates :phone, allow_blank: true, format: {with: VALID_PHONE_REGEX}
validates :user_id, uniqueness: true, allow_blank: true
validates_with BirthdateValidator

# This method needs to extract ids and run a new search to remain compatible
Expand Down
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 c087819

Please sign in to comment.