diff --git a/db-datos/migrate.ts b/db-datos/migrate.ts index b3f336a..632dc67 100644 --- a/db-datos/migrate.ts +++ b/db-datos/migrate.ts @@ -1,11 +1,11 @@ -import { migrate } from "drizzle-orm/better-sqlite3/migrator"; -import Database from "better-sqlite3"; -import { drizzle } from "drizzle-orm/better-sqlite3"; +import Database from "bun:sqlite"; +import { drizzle } from "drizzle-orm/bun-sqlite"; +import { migrate } from "drizzle-orm/bun-sqlite/migrator"; import * as schema from "./schema.js"; const sqlite = new Database("../scraper/sqlite.db"); const db = drizzle(sqlite, { schema }); -await migrate(db, { migrationsFolder: "./drizzle" }); +migrate(db, { migrationsFolder: "./drizzle" }); sqlite.close(); diff --git a/db-datos/package.json b/db-datos/package.json index 80dcd60..69661e8 100644 --- a/db-datos/package.json +++ b/db-datos/package.json @@ -5,7 +5,8 @@ "description": "", "main": "index.js", "scripts": { - "migrate": "node --import tsx/esm migrate.ts" + "migrate": "bun migrate.ts", + "generate": "drizzle-kit generate:sqlite" }, "keywords": [], "author": "",