koalasthegreat / AmoeboidBotRedux

1 stars 1 forks source link

Bot crashes when server config does not exist #23

Open koalasthegreat opened 3 days ago

koalasthegreat commented 3 days ago

When a message is sent in a server the bot is in without the wrapping being set, the bot crashes.

PrismaClientKnownRequestError:
Invalid `prisma.settings.findFirst()` invocation in
/home/pi/AmoeboidBot/src/settings/settings.ts:30:43

  27 public static async getWrapping(
  28   guild: Guild
  29 ): Promise<Option<{ left: string; right: string }>> {
→ 30   const getWrap = await prisma.settings.findFirst(
The table `main.Settings` does not exist in the current database.
koalasthegreat commented 2 days ago

Looking into this a bit further, this happens when the database isn't properly initialized with prisma migrate reset. We should look into what we should be doing here in production to deploy properly (and probably wrap it up in the Docker workflow)