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
There is an issue with CockroachDB after recent changes from their engine.
From what I can tell so far (after a couple hours of spelunking through the code), is that there is either an issue with the shadow_database creation or the table selection SQL statement is detecting more than it should. This is a problem that exists in both multi-region as well as single-region databases. The enum will exist in both cases; in the single region case, it just has one entry.
Prism should probably ignore the internal fields like this as they are mostly controlled through the configuration of the database and should not be managed by a schema.
There was a bug filed on the main prisma repo, but I believe the issue exists here in the engine. I opened a PR (#5108) that tries to restrict some of the data returning from the namespaces to skip internal tables, but I'm not convinced this is the right approach for the fix. There may be something in the Rust code that can ignore certain table pattern name (i.e. crdb_internal_*)
Quote from the original ticket:
Drift detected: Your database schema is not in sync with your migration history.
[-] Removed enums
crdb_internal_region
? We need to reset the CockroachDB database "defaultdb" at "your-cluster-url.cloud:26257"
This issue started occurring around November 8th, 2024. Prior to this, migrations were working correctly. The problem seems to be related to the introduction of the crdb_internal_region enum in CockroachDB's multi-region clusters, which causes Prisma to detect schema drift and fail the migration.
The text was updated successfully, but these errors were encountered:
As for your PR, thank you for that. Be advised that it may take us some time to review it, as we're currently focused on other features and improvements that align with the needs of consumers of more popular databases.
There is an issue with CockroachDB after recent changes from their engine.
From what I can tell so far (after a couple hours of spelunking through the code), is that there is either an issue with the shadow_database creation or the table selection SQL statement is detecting more than it should. This is a problem that exists in both multi-region as well as single-region databases. The enum will exist in both cases; in the single region case, it just has one entry.
Prism should probably ignore the internal fields like this as they are mostly controlled through the configuration of the database and should not be managed by a schema.
There was a bug filed on the main prisma repo, but I believe the issue exists here in the engine. I opened a PR (#5108) that tries to restrict some of the data returning from the namespaces to skip internal tables, but I'm not convinced this is the right approach for the fix. There may be something in the Rust code that can ignore certain table pattern name (i.e.
crdb_internal_*
)Quote from the original ticket:
The text was updated successfully, but these errors were encountered: