@fastmind/prisma-schema
v1.1.2
Published
- Install it using `bun add @fastmind/prisma-schema` - Install the prisma plugin using `bun add --dev @types/prisma__nextjs-monorepo-workaround-plugin` - Add the prisma plugin in `next.config.mjs` by adding the following.
Downloads
303
Readme
Fastmind prisma schema package
- Install it using
bun add @fastmind/prisma-schema
- Install the prisma plugin using
bun add --dev @types/prisma__nextjs-monorepo-workaround-plugin
- Add the prisma plugin in
next.config.mjs
by adding the following.
import { PrismaPlugin } from '@prisma/nextjs-monorepo-workaround-plugin'
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config, { isServer }) => {
if (isServer) {
config.plugins = [...config.plugins, new PrismaPlugin()]
}
return config
},
};
export default nextConfig;
Steps to fix the prisma conflicts
- copy the original schema.prisma file to schema-old.prisma
- run the command
bunx prisma db pull
- create a new blank migration file in the migrations folder
- run the command
bunx prisma migrate diff --from-schema-datamodel ./prisma/schema-old.prisma --to-schema-datamodel ./prisma/schema.prisma --script >> ./prisma/migrations/{name-of-created-migration}/migration.sql
- run the command
bunx prisma migrate resolve --applied {name-of-created-migration}
- delete the schema-old.prisma file