-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.topic: multiSchemamultiple schemasmultiple schemastopic: shadow databasetopic: sql serverMicrosoft SQL ServerMicrosoft SQL Server
Description
2024-04-02T07:53:58.682Z prisma:schemaEngine:stderr {"timestamp":"2024-04-02T07:53:58.682766692Z","level":"ERROR","fields":{"message":"Cannot drop the schema 'dbo'.","code":15150},"target":"tiberius::tds::stream::token","span":{"db.statement":"DROP SCHEMA IF EXISTS [dbo]","name":"quaint:query"},"spans":[{"name":"DevDiagnostic"},{"db.statement":"DROP SCHEMA IF EXISTS [dbo]","name":"quaint:query"}]}
2024-04-02T07:53:58.683Z prisma:schemaEngine:stderr {"timestamp":"2024-04-02T07:53:58.682822306Z","level":"INFO","fields":{"message":"Attempting best_effort_reset"},"target":"sql_schema_connector","span":{"namespaces":"Some(Namespaces(\"support\", [\"admin\", \"dbo\", \"test\"]))","name":"best_effort_reset"},"spans":[{"name":"DevDiagnostic"},{"namespaces":"Some(Namespaces(\"support\", [\"admin\", \"dbo\", \"test\"]))","name":"best_effort_reset"}]}
When running prisma migrate dev
, schemaEngine tries to drop the dbo
schema, fails and does not drop other table schemas from the schemas
list. This causes an error There is already an object named 'test' in the database.
Proposed solutions:
- Do not try dropping
dbo
schema (and other built-in schemas). It is impossible to do. - Sort schemas (namespaces) so
dbo
is the last, and when dropping fails, other schemas are already dropped.
Metadata
Metadata
Assignees
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.topic: multiSchemamultiple schemasmultiple schemastopic: shadow databasetopic: sql serverMicrosoft SQL ServerMicrosoft SQL Server