chore: update migrations

This commit is contained in:
Henry
2024-03-28 08:46:13 +00:00
parent b5b8ba0700
commit f1e705e9ae

View File

@@ -1,5 +1,11 @@
import 'dotenv/config';
import { migrate } from 'drizzle-orm/planetscale-serverless/migrator';
import { db } from './index';
migrate(db, { migrationsFolder: './src/server/db/migrations' }).catch((e) => console.log(e))
import { env } from "~/env.mjs";
import { drizzle } from 'drizzle-orm/postgres-js';
import { migrate } from 'drizzle-orm/postgres-js/migrator';
import postgres from 'postgres';
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
const migrationClient = postgres(env.POSTGRES_URL, { max: 1 });
migrate(drizzle(migrationClient), { migrationsFolder: './src/server/db/migrations' }).catch((e) => console.log(e))