:profile, class_name: 'UserProfile' end class UserCredential < ApplicationRecord belongs_to :user end class UserProfile < ApplicationRecord belongs_to :user end
do |t| t.string :email_address, null: false t.string :password_digest, null: false t.timestamps end add_index :users, :email_address, unique: true end end FNBJM@BEESFTT͕ͳ͍ͱVTFSʹͳΕͳ͍͔ɺͱ͍͏ͱͦΜͳ͜ͱͳ͍͜ͱ͕ଟ͍ͱࢥ͏ͷͰ͢ΑͶ
id FK user_id (nullable) FK email_verification_id favorite_editor ... created_at user_registration_ credentials PK id FK user_registration_id email email_verifications PK id token expires_at
w ࠷ॳ໘͔͠Εͳ͍͚ͲɺγϏΞͳݖݶͷ੍ޚΛͣͬͱҙࣝ͠ଓ͚ΔΑΓָͳͣ ɻ w ʮαʔϏεͷ͍ΖΜͳӡӦۀΛ͢ΔͨΊͷػೳ܈ʯͱͯͪ͠ΌΜͱ࡞Ζ͏ɻ ཧը໘͖ͳΜͰ͢ΑͶɻཧը໘ͦΕࣗମͱ͍͏͔ɺͦΕΛͬͯࣄۀΛҰॹʹ͍ͬͯΔਓͨͪͱͷ ؔੑ͕͖ɻཧը໘ͪΌΜͱ͢Δ͜ͱ·ͨҰͭͷਓؒؔͷΤΫααΠζͳΘ͚Ͱ͢Αɻ