diff --git a/services/kanao-gateway/src/Utilities/WebSockets/ProcessBootstrapper.ts b/services/kanao-gateway/src/Utilities/WebSockets/ProcessBootstrapper.ts index ca28c04a..efc387fa 100644 --- a/services/kanao-gateway/src/Utilities/WebSockets/ProcessBootstrapper.ts +++ b/services/kanao-gateway/src/Utilities/WebSockets/ProcessBootstrapper.ts @@ -19,6 +19,7 @@ import type { Channel, ConsumeMessage } from "amqplib"; import Database from "better-sqlite3"; import type { GatewaySendPayload } from "discord-api-types/v10"; import { drizzle } from "drizzle-orm/better-sqlite3/driver"; +import { migrate } from "drizzle-orm/better-sqlite3/migrator"; import type { Listener } from "../../Stores/Listener.js"; import { ListenerStore } from "../../Stores/ListenerStore.js"; import * as schema from "../../Structures/DatabaseSchema.js"; @@ -49,6 +50,9 @@ export class ProcessBootstrapper { * Bootstraps the child process with the provided options */ public async bootstrap(options: Readonly = {}): Promise { + await this.database.pragma("journal_mode = WAL"); + migrate(this.drizzle, { migrationsFolder: "dist/drizzle" }); + this.setupAmqp(); await this.stores.load(); // Start by initializing the shards