Skip to content

Commit

Permalink
docu(migrations): add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
FGoessler committed Jan 28, 2025
1 parent 9c937f5 commit f1f0547
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ pub async fn sql_schema_from_migrations_history(
namespaces: Option<Namespaces>,
) -> ConnectorResult<SqlSchema> {
if shadow_db.provider == CockroachDb {
// CockroachDB is very slow in applying DDL statements.
// A workaround to it is to run the statements in a transaction block. This comes with some
// drawbacks and limitations though, so we only apply this when creating a shadow db.
// See https://www.cockroachlabs.com/docs/stable/online-schema-changes#limitations
// Original GitHub issue with context: https://github.com/prisma/prisma/issues/12384#issuecomment-1152523689
shadow_db.raw_cmd("BEGIN;").await?;
}

Expand Down

0 comments on commit f1f0547

Please sign in to comment.