Add email to user model
This commit is contained in:
parent
16ab0fd6d3
commit
e41a5fc75c
@ -9,6 +9,7 @@ struct UserTableMigration: Migration {
|
||||
.field(User.Key.hash.key, .string, .required)
|
||||
.field(User.Key.points.key, .int, .required)
|
||||
.field(User.Key.table.key, .uuid, .references(Table.schema, Table.Key.id.key))
|
||||
.field(User.Key.recoveryEmail.key, .string)
|
||||
.create()
|
||||
let two = database.enum(Table.Key.language.rawValue)
|
||||
.case(SupportedLanguage.german.rawValue)
|
||||
|
@ -23,6 +23,7 @@ final class User: Model {
|
||||
case hash = "hash"
|
||||
case points = "points"
|
||||
case table = "table_id"
|
||||
case recoveryEmail = "email"
|
||||
|
||||
var key: FieldKey {
|
||||
.init(stringLiteral: rawValue)
|
||||
@ -44,6 +45,9 @@ final class User: Model {
|
||||
@Field(.hash)
|
||||
var passwordHash: String
|
||||
|
||||
@Field(.recoveryEmail)
|
||||
var recoveryEmail: String?
|
||||
|
||||
/// The user's total points
|
||||
@Field(.points)
|
||||
var points: Int
|
||||
|
Loading…
Reference in New Issue
Block a user