How to fix P3013: Datasource provider arrays are no longer supported in migrate in Prisma

PrismaINTERMEDIATEMEDIUMUpdated Dec 22, 2025ยท 109 views

This error occurs when you try to run Prisma migrations with an outdated schema format that uses arrays for datasource providers. Prisma migrated from array-based provider definitions to single provider strings, requiring schema updates before migrations can proceed.

Quick fix

Fixes P3013: Datasource provider arrays are no longer supported in migrate

// OLD FORMAT (causes error)
datasource db {
  provider = ["postgresql"]  // or ["mysql"], ["sqlite"], ["sqlserver"], ["cockroachdb"]
  url      = env("DATABASE_URL")
}

// Also check for multiple providers:
datasource db {
  provider = ["postgresql", "mysql"]  // This will cause the error
  url      = env("DATABASE_URL")
}
  1. Locate the datasource provider array in your schema.prisma file
  2. Convert the array to a single provider string
  3. Verify your Prisma version compatibility
  4. Test the migration after fixing the schema
prisma โ€” error
// OLD FORMAT (causes error)
datasource db {
provider = ["postgresql"] // or ["mysql"], ["sqlite"], ["sqlserver"], ["cockroachdb"]
url = env("DATABASE_URL")
}
// Also check for multiple providers:
datasource db {
provider = ["postgresql", "mysql"] // This will cause the error
url = env("DATABASE_URL")
}
P3013: Datasource provider arrays are no longer supported in migrate

What this error means

The P3013 error is a migration error that occurs when Prisma detects an outdated schema format in your `schema.prisma` file. In earlier versions of Prisma, datasource providers could be specified as arrays to support multiple database providers. However, this feature was deprecated and removed in favor of single provider strings. When you run `prisma migrate dev` or `prisma migrate deploy`, Prisma checks your schema for compatibility. If it finds array syntax like `provider = ["postgresql", "mysql"]` or `provider = ["sqlite"]`, it throws this error because the migration engine no longer supports parsing these array definitions. This change was made to simplify the schema format and improve type safety. Instead of arrays, you now specify a single provider string like `provider = "postgresql"`. The error prevents migrations from running until you update your schema to the new format.

Typical symptoms

  • Prisma migrate commands fail with "P3013: Datasource provider arrays are no longer supported in migrate"
  • Database migrations cannot be applied or generated
  • CI/CD pipelines fail during database migration steps
  • The error appears when running `prisma migrate dev`, `prisma migrate deploy`, or `prisma db push`
  • Existing migrations may fail to apply after upgrading Prisma versions

Common causes

  1. Using an outdated Prisma schema format from earlier Prisma versions (pre-3.0.0)
  2. Copying schema files from older projects that used array-based provider syntax
  3. Upgrading Prisma without updating the schema.prisma file
  4. Having multiple provider entries in array format like `provider = ["postgresql", "mysql"]`
  5. Legacy schema configurations that were never migrated to the new single-provider format

How to fix "P3013: Datasource provider arrays are no longer supported in migrate"

1Locate the datasource provider array in your schema.prisma file

Open your schema.prisma file and look for the datasource block. Check if the provider field uses array syntax:

prisma
// OLD FORMAT (causes error)
datasource db {
  provider = ["postgresql"]  // or ["mysql"], ["sqlite"], ["sqlserver"], ["cockroachdb"]
  url      = env("DATABASE_URL")
}

// Also check for multiple providers:
datasource db {
  provider = ["postgresql", "mysql"]  // This will cause the error
  url      = env("DATABASE_URL")
}

The error occurs because Prisma no longer supports array notation for the provider field.

2Convert the array to a single provider string

Update the provider field to use a single string value instead of an array:

prisma
// NEW FORMAT (correct)
datasource db {
  provider = "postgresql"  // Single string, no brackets
  url      = env("DATABASE_URL")
}

If you had multiple providers in the array, you need to choose one primary database provider. Prisma no longer supports declaring multiple providers in a single datasource.

3Verify your Prisma version compatibility

Check your Prisma version to ensure you're using a compatible version:

bash
npx prisma --version

If you're using a very old version of Prisma (before 3.0.0), consider upgrading to a more recent version. The array syntax was deprecated around Prisma 2.x and removed in later versions.

Update Prisma if needed:

bash
npm install @prisma/client@latest
npm install prisma@latest --save-dev
4Test the migration after fixing the schema

After updating your schema.prisma file, try running the migration command again:

bash
npx prisma migrate dev

Or if you're deploying to production:

bash
npx prisma migrate deploy

The error should no longer appear, and migrations should proceed normally. If you still encounter issues, check for other outdated syntax in your schema.

5Handle multiple database scenarios (if applicable)

If you previously used provider arrays to support multiple databases, you now need a different approach:

1. Separate schemas: Create separate schema.prisma files for each database environment
2. Environment variables: Use different DATABASE_URL values for different environments
3. Database abstraction: Consider using a database abstraction layer if you need to support multiple database types

Example for multiple environments:

prisma
// schema.prisma (development - PostgreSQL)
datasource db {
  provider = "postgresql"
  url      = env("DEV_DATABASE_URL")
}

// schema.test.prisma (testing - SQLite)
datasource db {
  provider = "sqlite"
  url      = env("TEST_DATABASE_URL")
}

Use different schema files with the --schema flag:

bash
npx prisma migrate dev --schema=./prisma/schema.test.prisma

Advanced notes

Historical Context: The array syntax for datasource providers was introduced in early Prisma 2.x versions as an experimental feature to allow schema definitions that could target multiple database types. This was particularly useful for projects that needed to support different databases in development vs production (e.g., SQLite locally, PostgreSQL in production).

Why it was removed: The feature was removed because:
1. It added complexity to the Prisma migration engine
2. It caused confusion about which database was actually being used
3. Most users only needed a single database provider
4. It complicated type generation and query optimization

Migration path: When Prisma removed this feature, they provided a migration path where the first element of the array would be used as the single provider. So ["postgresql", "mysql"] would become "postgresql".

Checking other outdated syntax: While fixing the P3013 error, also check for other deprecated syntax in your schema:
- Old generator syntax: provider = "prisma-client-js" (should be lowercase)
- Deprecated relation syntax: @relation(name: "UserPosts", fields: [authorId], references: [id])
- Old enum syntax (if using very old Prisma versions)

Prevention: To avoid this error in the future:
1. Keep Prisma and its dependencies updated regularly
2. Review breaking changes in Prisma release notes
3. Use Prisma's version compatibility checks
4. Maintain a single, clear database provider per environment

Frequently asked questions

What does "P3013: Datasource provider arrays are no longer supported in migrate" mean?
prisma file. In earlier versions of Prisma, datasource providers could be specified as arrays to support multiple database providers. However, this feature was deprecated and removed in favor of single provider strings.
How do I fix "P3013: Datasource provider arrays are no longer supported in migrate"?
This error occurs when you try to run Prisma migrations with an outdated schema format that uses arrays for datasource providers. Prisma migrated from array-based provider definitions to single provider strings, requiring schema updates before migrations can proceed.
What causes "P3013: Datasource provider arrays are no longer supported in migrate"?
Using an outdated Prisma schema format from earlier Prisma versions (pre-3.0.0) Copying schema files from older projects that used array-based provider syntax Upgrading Prisma without updating the schema.prisma file
Is the "P3013: Datasource provider arrays are no longer supported in migrate" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading