New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[multiSchema previewFeature] The database schema is not empty error on prisma migrate dev
#21007
Comments
Yep same thing for Migrator should detect somehow if it tries to migrate multischemas or it should be prohibited completely at least without a flag on the CLI like |
Steps:
generator client {
provider = "prisma-client-js"
previewFeatures = ["multiSchema"]
}
datasource db {
provider = "postgresql"
url = env("TEST_POSTGRES_URI")
schemas = ["app"]
}
model NewTable {
id BigInt @id
@@schema("app")
}
This was performed on the following version: "devDependencies": {
"prisma": "5.10.2"
} Switching to
|
Based on the process defined and what I followed above, I feel like I'm missing something as I cannot reproduce the error you outlined:
@leppaott can you help me understand more of your setup going into encountering this error? Edit:
|
prisma migrate dev
I've split the issue with |
This is the schema I used to test without generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("TEST_POSTGRES_URI")
} As far as this being fixed when you remove the the Are you then directly including
If I directly include the schema in the connection url by appending the following We can correctly introspect the database
model NewTable {
id BigInt @id
} However, I still run into a drift error on
|
cc: @reza-ebrahimi |
@reza-ebrahimi do you still need help here? |
Hey @reza-ebrahimi, With the lack of information and our inability to reproduce this issue, we're now closing it. Feel free to comment if you have any updates about it. Thank you 🙏 |
Original issue: #21003
Relevant details surfaced in discussion: the behaviour is different depending on whether
multiSchema
is enabled. The error does not happen without the preview feature.Discussed in #21005
Originally posted by reza-ebrahimi September 7, 2023
Bug description
Here is my schema, after having a fesh schema and table in postgres
prisma migrate dev
throws following error:The database schema is not empty
Reproduce:
$ manually created an schema and a table in pgAdmin $ npx prisma db pull $ npx prisma migrate dev .... Error: P3005 The database schema is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline
How to reproduce
$ manually created an schema and a table in pgAdmin $ npx prisma db pull $ npx prisma migrate dev .... Error: P3005 The database schema is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline
Expected behavior
No response
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: