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.hash.key, .string, .required)
|
||||||
.field(User.Key.points.key, .int, .required)
|
.field(User.Key.points.key, .int, .required)
|
||||||
.field(User.Key.table.key, .uuid, .references(Table.schema, Table.Key.id.key))
|
.field(User.Key.table.key, .uuid, .references(Table.schema, Table.Key.id.key))
|
||||||
|
.field(User.Key.recoveryEmail.key, .string)
|
||||||
.create()
|
.create()
|
||||||
let two = database.enum(Table.Key.language.rawValue)
|
let two = database.enum(Table.Key.language.rawValue)
|
||||||
.case(SupportedLanguage.german.rawValue)
|
.case(SupportedLanguage.german.rawValue)
|
||||||
|
@ -23,6 +23,7 @@ final class User: Model {
|
|||||||
case hash = "hash"
|
case hash = "hash"
|
||||||
case points = "points"
|
case points = "points"
|
||||||
case table = "table_id"
|
case table = "table_id"
|
||||||
|
case recoveryEmail = "email"
|
||||||
|
|
||||||
var key: FieldKey {
|
var key: FieldKey {
|
||||||
.init(stringLiteral: rawValue)
|
.init(stringLiteral: rawValue)
|
||||||
@ -44,6 +45,9 @@ final class User: Model {
|
|||||||
@Field(.hash)
|
@Field(.hash)
|
||||||
var passwordHash: String
|
var passwordHash: String
|
||||||
|
|
||||||
|
@Field(.recoveryEmail)
|
||||||
|
var recoveryEmail: String?
|
||||||
|
|
||||||
/// The user's total points
|
/// The user's total points
|
||||||
@Field(.points)
|
@Field(.points)
|
||||||
var points: Int
|
var points: Int
|
||||||
|
Loading…
Reference in New Issue
Block a user