We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c74abe8 commit 917331dCopy full SHA for 917331d
1 file changed
packages/db/src/client.ts
@@ -1,4 +1,5 @@
1
import { drizzle } from 'drizzle-orm/node-postgres';
2
+import { migrate } from 'drizzle-orm/node-postgres/migrator';
3
import * as schema from './drizzle/schema';
4
import * as relations from './drizzle/relations';
5
@@ -11,4 +12,10 @@ if (!databaseUrl) {
11
12
throw new Error('DATABASE_URL is not set');
13
}
14
-export const db = drizzle(databaseUrl, { schema: fullSchema });
15
+export const db = drizzle(databaseUrl, { schema: fullSchema });
16
+
17
+const migrateDb = async () => {
18
+ await migrate(db, { migrationsFolder: 'drizzle/migrations' });
19
+}
20
21
+migrateDb();
0 commit comments