- Refactored ESLint configuration for better clarity and organization, including updates to TypeScript rules and Next.js app settings. - Upgraded package dependencies, including Next.js to version 16.0.8 and Prisma to version 7.1.0, enhancing performance and compatibility. - Modified Dockerfile for BFF to reflect updated Prisma version and optimize build settings. - Improved Prisma service to utilize PostgreSQL connection pooling with the new PrismaPg adapter, ensuring better database management. - Cleaned up TypeScript configuration files for consistency and updated module settings to align with ESNext standards. - Adjusted pre-commit script to streamline security audits and removed unnecessary linting during development.
30 lines
892 B
TypeScript
30 lines
892 B
TypeScript
import { defineConfig } from "prisma";
|
|
import { PrismaPg } from "@prisma/adapter-pg";
|
|
import { Pool } from "pg";
|
|
|
|
/**
|
|
* Prisma 7 Configuration
|
|
*
|
|
* This configuration file is required for Prisma 7+ where the datasource URL
|
|
* is no longer specified in schema.prisma. Instead, connection configuration
|
|
* is provided here for migrations and in the PrismaClient constructor for runtime.
|
|
*
|
|
* @see https://pris.ly/d/config-datasource
|
|
* @see https://pris.ly/d/prisma7-client-config
|
|
*/
|
|
export default defineConfig({
|
|
earlyAccess: true,
|
|
schema: "./schema.prisma",
|
|
migrate: {
|
|
adapter: async () => {
|
|
const connectionString = process.env.DATABASE_URL;
|
|
if (!connectionString) {
|
|
throw new Error("DATABASE_URL environment variable is required for migrations");
|
|
}
|
|
const pool = new Pool({ connectionString });
|
|
return new PrismaPg(pool);
|
|
},
|
|
},
|
|
});
|
|
|