preciazo/db-datos/migrate.ts

12 lines
343 B
TypeScript
Raw Normal View History

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