Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
fix: migrate in memory
Browse files Browse the repository at this point in the history
  • Loading branch information
KagChi committed Feb 22, 2024
1 parent f2a30fc commit 6975af6
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -49,6 +50,9 @@ export class ProcessBootstrapper {
* Bootstraps the child process with the provided options
*/
public async bootstrap(options: Readonly<BootstrapOptions> = {}): Promise<void> {
await this.database.pragma("journal_mode = WAL");
migrate(this.drizzle, { migrationsFolder: "dist/drizzle" });

this.setupAmqp(); await this.stores.load();

// Start by initializing the shards
Expand Down

0 comments on commit 6975af6

Please sign in to comment.