changes to imports & import Embeddings
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import 'dotenv/config';
|
||||
import { drizzle } from 'drizzle-orm/node-postgres';
|
||||
import pkg from 'pg';
|
||||
const { Pool } = pkg;
|
||||
import * as schema from './schema.js';
|
||||
import { migrate } from 'drizzle-orm/node-postgres/migrator';
|
||||
const connectionString = process.env.DATABASE_URL
|
||||
const pool = new Pool({connectionString})
|
||||
const { Pool } = pkg;
|
||||
const connectionString = process.env.DATABASE_URL;
|
||||
const pool = new Pool({ connectionString });
|
||||
const db = drizzle(pool, { schema });
|
||||
// This will run migrations on the database, skipping the ones already applied
|
||||
await migrate(db, { migrationsFolder: './src/drizzle/migrations' });
|
||||
//await migrate(db, { migrationsFolder: './src/drizzle/migrations' });
|
||||
// Don't forget to close the connection, otherwise the script will hang
|
||||
await pool.end();
|
||||
//await pool.end();
|
||||
|
||||
Reference in New Issue
Block a user