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

Commit

Permalink
fix: use node-postgres for migration
Browse files Browse the repository at this point in the history
  • Loading branch information
KagChi committed Feb 21, 2024
1 parent f3f75dd commit f54259b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions services/kanao-gateway/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import { fileURLToPath } from "node:url";
import { Util } from "@nezuchan/utilities";
import { range } from "@sapphire/utilities";
import { createBanner } from "@skyra/start-banner";
import { drizzle } from "drizzle-orm/postgres-js";
import { migrate } from "drizzle-orm/postgres-js/migrator";
import { drizzle } from "drizzle-orm/node-postgres";
import { migrate } from "drizzle-orm/node-postgres/migrator";
import gradient from "gradient-string";
import postgres from "postgres";
import pg from "pg";
import { NezuGateway } from "./Structures/KanaoGateway.js";
import { databaseUrl, getShardCount, replicaCount, replicaId } from "./config.js";

const gateway = new NezuGateway();
const packageJson = Util.loadJSON<{ version: string; }>(`file://${join(fileURLToPath(import.meta.url), "../../package.json")}`);
const shardIds = await getShardCount();

const migClient = postgres(databaseUrl, { max: 1, onnotice: notice => gateway.logger.debug(notice, "Migrating Table") });
const migClient = new pg.Client(databaseUrl);

await migrate(drizzle(migClient), { migrationsFolder: "./node_modules/@nezuchan/kanao-schema/drizzle" });

Expand Down

0 comments on commit f54259b

Please sign in to comment.