Skip to content

Commit

Permalink
Add uniqueness enforcement to user and group custom attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMacNaughton committed Jan 12, 2021
1 parent 2d29c5e commit c0b497e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddUniqueConstraintsToCustomTypes < ActiveRecord::Migration[6.0]
def change
add_index :custom_userdata, [ :user_id, :custom_userdata_type_id ], :unique => true, name: :custom_userdata_unique
add_index :custom_groupdata, [ :group_id, :custom_group_data_type_id ], :unique => true, name: :custom_groupdata_unique
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
t.datetime "updated_at", null: false
t.index ["key_handle"], name: "index_fido_usf_devices_on_key_handle"
t.index ["last_authenticated_at"], name: "index_fido_usf_devices_on_last_authenticated_at"
t.index ["user_type", "user_id"], name: "index_fido_usf_devices_on_user_type_and_user_id"
t.index ["user_type", "user_id"], name: "index_fido_usf_devices_on_user"
end

create_table "friendly_id_slugs", force: :cascade do |t|
Expand Down Expand Up @@ -109,7 +109,7 @@
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "auth_type", default: "New Login"
t.index ["service_provider_type", "service_provider_id"], name: "index_logins_on_service_provider_type_and_service_provider_id"
t.index ["service_provider_type", "service_provider_id"], name: "index_logins_on_service_provider"
t.index ["user_id"], name: "index_logins_on_user_id"
end

Expand Down

0 comments on commit c0b497e

Please sign in to comment.