Skip to content

Commit

Permalink
migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Inalegwu committed Jul 24, 2024
1 parent c354813 commit c07e93c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/shared/storage.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import Database from "better-sqlite3";
import { drizzle } from "drizzle-orm/better-sqlite3";
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
import path from "node:path";
import * as schema from "./schema";

const dbPath = import.meta.env.DEV
? "vision.db"
: path.join(process.resourcesPath, "./vision.db");

const sqlite = new Database(dbPath);
const sqlite = new Database("vision.db");
const db = drizzle(sqlite, { schema });

migrate(db, { migrationsFolder: ".drizzle" });
migrate(db, { migrationsFolder: "drizzle" });

export default db;

0 comments on commit c07e93c

Please sign in to comment.