mirror of
https://github.com/wassname/talk.git
synced 2026-08-08 11:28:12 +08:00
[CORL-649] Migrations (#2597)
* feat: added migration framework * chore: added premod user status migration * feat: enhanced error handling of migrations * fix: added missing argument from abstract method * fix: another templating blunder * fix: removed debug code * feat: enhanced migration tracking * fix: remove skipping migrations * feat: moved indexing to migration system * fix: linting
This commit is contained in:
@@ -31,8 +31,7 @@ export const UserStatus: Required<
|
||||
}
|
||||
|
||||
// If they are set to mandatory premod, then mark it.
|
||||
// FIXME: (wyattjoh) once migration has been performed, remove check
|
||||
if (consolidatedStatus.premod && consolidatedStatus.premod.active) {
|
||||
if (consolidatedStatus.premod.active) {
|
||||
statuses.push(GQLUSER_STATUS.PREMOD);
|
||||
}
|
||||
|
||||
@@ -55,17 +54,8 @@ export const UserStatus: Required<
|
||||
...user.consolidateUserSuspensionStatus(suspension),
|
||||
userID,
|
||||
}),
|
||||
// FIXME: (wyattjoh) once migration has been performed, return PremodStatusInput only
|
||||
premod: ({ premod, userID }): PremodStatusInput | null => {
|
||||
const status = user.consolidateUserPremodStatus(premod);
|
||||
// FIXME: (wyattjoh) once migration has been performed, remove check
|
||||
if (!status) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
...status,
|
||||
userID,
|
||||
};
|
||||
},
|
||||
premod: ({ premod, userID }): PremodStatusInput => ({
|
||||
...user.consolidateUserPremodStatus(premod),
|
||||
userID,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -1541,10 +1541,8 @@ type UserStatus {
|
||||
|
||||
"""
|
||||
premod stores the user premod status as well as the history of changes.
|
||||
|
||||
FIXME: (wyattjoh) once migration has been performed, make non-nullable
|
||||
"""
|
||||
premod: PremodStatus @auth(roles: [ADMIN, MODERATOR])
|
||||
premod: PremodStatus! @auth(roles: [ADMIN, MODERATOR])
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user