diff --git a/Sources/App/Model/Migrations/UserTableMigration.swift b/Sources/App/Model/Migrations/UserTableMigration.swift index 5d5590d..384ad19 100644 --- a/Sources/App/Model/Migrations/UserTableMigration.swift +++ b/Sources/App/Model/Migrations/UserTableMigration.swift @@ -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) diff --git a/Sources/App/Model/User.swift b/Sources/App/Model/User.swift index bbcdae6..ebc8807 100644 --- a/Sources/App/Model/User.swift +++ b/Sources/App/Model/User.swift @@ -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