PrismaP
Prisma2mo ago
6 replies
SergioNR

Difficulties migrating PostgreSQL to v7.0.0

Hello,

PS: Im using PostgreSQL v17.5

I am trying to upgrade from PrismaORM v6.5 to v7 and im finding the following error:

node:internal/modules/esm/resolve:274
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/<username>/repos/server/server/config/generated/prisma/client/enums' imported from /Users/<username>/repos/server/server/config/generated/prisma/client/client.ts


My current setup is:

prisma.config.ts
 prisma.config.ts
import { defineConfig, env } from "prisma/config";

export default defineConfig({
  schema: './schema.prisma',
  migrations: { 
    path: './migrations',
    seed: 'tsx prisma/seed.ts',
  },
  datasource: { 
    url: env("PRISMA_POSTGRES_DIRECT_URL"),
  }
});


prisma.schema

generator client {
  provider = "prisma-client"
  output   = "../server/config/generated/prisma/client"
}

datasource db {
  provider = "postgresql"
}


example implementation on userModel.js

import { PrismaClient } from '../config/generated/prisma/client/index.js';

const prisma = new PrismaClient();

export const createCustomerInDB = async (userData) => {
  const createUserInDbQuery = await prisma.user.create({
    data: {
      email: userData.username,
      password: userData.password,
      role: userData.role,
      },
      Company: {
        create: {
        },
      },
    },
  });


Im trying to follow the prisma-provided migration guide but i dont think im successfully doing so

files:
* schema.prisma
* prisma.config.ts

are located in ./prisma
image.png
Guide on how to upgrade to Prisma ORM 7
Upgrade to Prisma ORM 7 | Prisma Documentation
Was this page helpful?