diff --git a/src/database/models/player.model.ts b/src/database/models/player.model.ts index d8305d3b..dff6f5f3 100644 --- a/src/database/models/player.model.ts +++ b/src/database/models/player.model.ts @@ -11,7 +11,6 @@ export interface PlayerAvatar { export enum PlayerRole { superUser = 'super user', admin = 'admin', - bot = 'bot', } export interface PlayerModel { diff --git a/src/migrations/001-use-steam-ids-in-game-slots-and-events.ts b/src/migrations/001-use-steam-ids-in-game-slots-and-events.ts index aabb39d6..37e70466 100644 --- a/src/migrations/001-use-steam-ids-in-game-slots-and-events.ts +++ b/src/migrations/001-use-steam-ids-in-game-slots-and-events.ts @@ -126,7 +126,7 @@ export async function up() { throw new Error(`actor ${event.actor.toString()} not found (game #${game.number})`) } - if (a.roles.includes(PlayerRole.bot)) { + if (a.roles.includes('bot' as PlayerRole)) { actor = 'bot' as Bot } else { actor = a.steamId diff --git a/src/migrations/002-remove-bot-player.ts b/src/migrations/002-remove-bot-player.ts new file mode 100644 index 00000000..cd668056 --- /dev/null +++ b/src/migrations/002-remove-bot-player.ts @@ -0,0 +1,8 @@ +// Remove the bot player that was previously used to indicate automatic actions - subbed-out players, closed games, etc. + +import { collections } from '../database/collections' +import type { PlayerRole } from '../database/models/player.model' + +export async function up() { + await collections.players.deleteOne({ roles: 'bot' as PlayerRole }) +}