UserSaveRestoreData
struct UserSaveRestoreData : Content
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
var username: String
-
Declaration
Swift
var displayName: String?
-
Declaration
Swift
var realName: String?
-
Declaration
Swift
var password: String
-
Declaration
Swift
var recoveryKey: String
-
Declaration
Swift
var verification: String
-
Declaration
Swift
var accessLevel: UserAccessLevel
-
Declaration
Swift
var userImage: String?
-
Declaration
Swift
var about: String?
-
Declaration
Swift
var email: String?
-
Declaration
Swift
var homeLocation: String?
-
Declaration
Swift
var message: String?
-
Declaration
Swift
var preferredPronoun: String?
-
Declaration
Swift
var roomNumber: String?
-
Declaration
Swift
var dinnerTeam: DinnerTeam?
-
Declaration
Swift
var parentUsername: String?
-
Declaration
Swift
var roles: [UserRoleType]
-
Event UIDs, the thing in the ICS file spec–NOT database IDs!
Declaration
Swift
var favoriteEvents: [String]
-
For shadow event organizers, their associated Performer data (which contains the event UIDs for the events ‘they’re running).
Declaration
Swift
var performer: PerformerUploadData?
-
For this to work: Must use
.with(\.$roles).with(\.$favoriteEvents).with(\.$performer).with(\.$performer.events)
in queryDeclaration
Swift
init?(user: User)