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

Commit

Permalink
fix: dont run migration at gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
KagChi committed Feb 22, 2024
1 parent 5d1a113 commit 4d7cae6
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions services/kanao-gateway/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,14 @@ 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/node-postgres";
import { migrate } from "drizzle-orm/node-postgres/migrator";
import gradient from "gradient-string";
import pg from "pg";
import { NezuGateway } from "./Structures/KanaoGateway.js";
import { databaseUrl, getShardCount, replicaCount, replicaId } from "./config.js";
import { 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 = new pg.Client(databaseUrl);

await migClient.connect();

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

await migClient.end();

try {
await gateway.connect();
} catch (error) {
Expand Down

0 comments on commit 4d7cae6

Please sign in to comment.