preciazo/db-datos/migrate.ts

12 lines
361 B
TypeScript
Raw Normal View History

2023-12-23 23:29:55 +00:00
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
import Database from "better-sqlite3";
import { drizzle } from "drizzle-orm/better-sqlite3";
import * as schema from "./schema.js";
const sqlite = new Database("../scraper/sqlite.db");
const db = drizzle(sqlite, { schema });
await migrate(db, { migrationsFolder: "./drizzle" });
sqlite.close();