PrismaP
Prisma4mo ago
2 replies
gosip

Help with the new Prisma Config "Migrations" Field Missing

Hey everyone

I'm trying to update my code and after running npm i I got Prisma version 6.11^ as part of the update. I knew they were going to deprecate the old method in package.json, but now I'm running into an issue.

Every tutorial and the official docs mention a field called migrations in the defineConfig method but I can't find it anywhere. When I try to use it I get the following error:

Object literal may only specify known properties and 'migrations' does not exist in type 'PrismaConfig<never>'

Here's my code

import { defineConfig } from "prisma/config";

export default defineConfig({
  schema: "src/models/schema.prisma",
  migrations: { // error Object literal may only specify known properties, and 'migrations' does not exist in type 'PrismaConfig<never>'
    seed: "tsx src/lib/seed.ts",
  },
});


My main issue is that I want to customize where my seed file and the schema is placed but the docs don't seem to match the latest version of Prisma.

I also looked at the Prisma source code and found this type definition:

/**
 * Define the configuration for the Prisma Development Kit.
 */
export declare function defineConfig<Env extends Record<string, string | undefined> = never>(configInput: PrismaConfig<Env>): PrismaConfigInternal<Env>;
...
/**
 * The configuration for the Prisma Development Kit, before it is passed to the `defineConfig` function.
 * Thanks to the branding, this type is opaque and cannot be constructed directly.
 */
export declare type PrismaConfig<Env extends EnvVars = never> = {
    earlyAccess: true;
    schema?: string;
    studio?: PrismaStudioConfigShape<Env>;
    migrate?: PrismaMigrateConfigShape<Env>;
};


Can anyone help me figure out how I can properly set up a seed file or migrate configuration in the new setup? It seems like the migrations field is no longer valid.

Thanks in advance!
image.png
image.png
Was this page helpful?