UserSaveRestoreData
struct UserSaveRestoreData : Content, Sendable
Used to bulk save/restore user accounts. This was created to allow us to download an archive of all registered users from the staging server just before embarkation, and then load the archived users onto the prod server as soon as we get on the boat.
Just archiving User
s directly would work, but using a DTO gives us better control in the case of schema changes between staging and prod, or if
we need to massage the data to get the restore to work correctly. Also, this method tries whenever possible to put data from related tables we want
to save/restore right in the User object; otherwise we’d have to export RegistrationCode
and EventFavorite
(and maybe a bunch of other tables)
and match everything up as part of import.
Also: This DTO contains sensitive data and should only be used for Admin routes.
-
Declaration
Swift
let username: String
-
Declaration
Swift
let displayName: String?
-
Declaration
Swift
let realName: String?
-
Declaration
Swift
let password: String
-
Declaration
Swift
let recoveryKey: String
-
Declaration
Swift
let verification: String
-
Declaration
Swift
let accessLevel: UserAccessLevel
-
Declaration
Swift
let userImage: String?
-
Declaration
Swift
let about: String?
-
Declaration
Swift
let email: String?
-
Declaration
Swift
let homeLocation: String?
-
Declaration
Swift
let message: String?
-
Declaration
Swift
let preferredPronoun: String?
-
Declaration
Swift
let roomNumber: String?
-
Declaration
Swift
let dinnerTeam: DinnerTeam?
-
Declaration
Swift
let parentUsername: String?
-
Declaration
Swift
let roles: [UserRoleType]
-
Event UIDs, the thing in the ICS file spec–NOT database IDs!
Declaration
Swift
let favoriteEvents: [String]
-
For shadow event organizers, their associated Performer data (which contains the event UIDs for the events ‘they’re running).
Declaration
Swift
let performer: PerformerUploadData?
-
For this to work: Must use
.with(\.$roles).with(\.$favoriteEvents).with(\.$performer).with(\.$performer.events)
in queryDeclaration
Swift
init?(user: User)