You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: ORM-1269 fix table recreation through default schema (#5561)
This PR fixes an issue when enabling the multi schema preview feature
but not using explicit schema names and relying on the default schema
instead.
During diffing the existing tables in the database/applied migrations
were introspected with a namespace (the db default one from the
connection string). But the tables from the schema file (the target
state) didn't have a namespace.
=> actually identical tables were treated as different => tables got
dropped and created
This PR fixes this by making the schema generated from the schema file
aware of the default schema name. Tables in both schemas now have the
same schema name and diffing works as intended.
message = "When using an explicit schemas list in your datasource, `externalTables` in your prisma config must contain only fully qualified table names (e.g. `schema_name.table_name`)."
292
+
message = "For the current database, `externalTables` & `externalEnums` in your prisma config must contain only fully qualified identifiers (e.g. `schema_name.table_name`)."
293
293
)]
294
294
pubstructMissingNamespaceInExternalTables;
295
295
296
296
#[derive(Debug,SimpleUserFacingError)]
297
297
#[user_facing(
298
298
code = "P3024",
299
-
message = "When using no explicit schemas list in your datasource, `externalTables` in your prisma config must contain only simple table names without a schema name."
299
+
message = "For the current database, `externalTables` & `externalEnums` in your prisma config must contain only simple identifiers without a schema name."
0 commit comments