diff --git a/db/migrations/00000000000001_create_users.cr b/db/migrations/00000000000001_create_users.cr index 673967f..27444dc 100644 --- a/db/migrations/00000000000001_create_users.cr +++ b/db/migrations/00000000000001_create_users.cr @@ -5,7 +5,7 @@ class CreateUsers::V00000000000001 < Avram::Migrator::Migration::V1 add name : String, unique: true add encrypted_password : String # NOTE: Should really be called 'password_hash' - add email : String?, unique: true + add email : String, unique: true # NOTE: Should be nilable, but Carbon::Emailable doesn't really support it add created_at : Time end end diff --git a/src/models/role.cr b/src/models/role.cr index 0b84dde..de74138 100644 --- a/src/models/role.cr +++ b/src/models/role.cr @@ -3,6 +3,6 @@ class Role < BaseModel column name : String column description : String? - has_many users : User, foreign_key: :primary_role_id ##### + has_many users : User, foreign_key: :primary_role_id end end diff --git a/src/models/user.cr b/src/models/user.cr index bcbe28d..3d0a4a8 100644 --- a/src/models/user.cr +++ b/src/models/user.cr @@ -5,7 +5,7 @@ class User < BaseModel table do column name : String column encrypted_password : String - column email : String? + column email : String column created_at : Time belongs_to primary_role : Role