Update database connection path: Change DATABASE_URL in .env and related files to point to the new data directory for SQLite database.
This commit is contained in:
2
.env
2
.env
@@ -5,6 +5,6 @@
|
||||
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
|
||||
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
|
||||
|
||||
DATABASE_URL="file:./dev.db"
|
||||
DATABASE_URL="file:./data/dev.db"
|
||||
AUTH_SECRET="your-secret-key-change-this-in-production"
|
||||
AUTH_URL="http://localhost:3000"
|
||||
|
||||
@@ -2,7 +2,7 @@ import { PrismaClient } from "@/prisma/generated/prisma/client";
|
||||
import { PrismaBetterSqlite3 } from "@prisma/adapter-better-sqlite3";
|
||||
|
||||
const adapter = new PrismaBetterSqlite3({
|
||||
url: process.env.DATABASE_URL || "file:./dev.db",
|
||||
url: process.env.DATABASE_URL || "file:./data/dev.db",
|
||||
});
|
||||
|
||||
const globalForPrisma = globalThis as unknown as {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { PrismaBetterSqlite3 } from "@prisma/adapter-better-sqlite3";
|
||||
import bcrypt from "bcryptjs";
|
||||
|
||||
const adapter = new PrismaBetterSqlite3({
|
||||
url: process.env.DATABASE_URL || "file:./dev.db",
|
||||
url: process.env.DATABASE_URL || "file:./data/dev.db",
|
||||
});
|
||||
const prisma = new PrismaClient({ adapter });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user