-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
When configuring the Multi-file Prisma schema using the package.json approach as documented here, the migrations folder and SQL files are created in the wrong location.
Configuration ⚙️
The following configuration was used in package.json:
"prisma": {
"schema": "./prisma"
}Observed Behavior 🐛
The SQL files for migrations (those with the descriptive comment) are being generated in the root ./migrations folder instead of the expected ./prisma/migrations folder.
Furthermore, the SQL in these incorrectly placed files is not being applied (migrations fail to execute or are not tracked correctly).
Expected Behavior ✅
When package.json is configured with "schema": "./prisma", running Prisma migration commands (e.g., prisma migrate dev) should:
Create the migrations folder at ./prisma/migrations.
Generate the SQL migration files inside ./prisma/migrations.
Successfully apply the SQL schema changes to the database.
Steps to Reproduce 👣
Set up a project with the prisma config in package.json as shown above.
Create a multi-file schema inside the ./prisma directory.
Run a migration command, e.g., npx prisma migrate dev --name init.
Observe that the new migration folder is created at ./migrations (root), not ./prisma/migrations.
Attempt to run the migration. (It will likely fail or not apply the schema correctly).