From 380bd79441504c26aa52d3556b3a1c89cc06838f Mon Sep 17 00:00:00 2001 From: Levin Dixon Date: Mon, 22 Jan 2024 16:53:16 -0700 Subject: [PATCH 1/2] Improve schema drift message clarity --- schema-engine/core/src/commands/dev_diagnostic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema-engine/core/src/commands/dev_diagnostic.rs b/schema-engine/core/src/commands/dev_diagnostic.rs index 7eed03f0ce5d..28d6efe016fe 100644 --- a/schema-engine/core/src/commands/dev_diagnostic.rs +++ b/schema-engine/core/src/commands/dev_diagnostic.rs @@ -106,7 +106,7 @@ Drift detected: Your database schema is not in sync with your migration history. The following is a summary of the differences between the expected database schema given your migrations files, and the actual schema of the database. -It should be understood as the set of changes to get from the expected schema to the actual schema. +This summary details discrepancies by listing elements found in the current database schema but missing in your Prisma schema, indicating the Prisma schema updates required for alignment. "#; const FIRST_TIME_MIGRATION_MESSAGE: &str = r#" From 193a971e4594e327c48e4bec287d163d8c124ff6 Mon Sep 17 00:00:00 2001 From: Levin Dixon Date: Mon, 22 Jan 2024 16:53:42 -0700 Subject: [PATCH 2/2] Update tests --- .../tests/migrations/dev_diagnostic_tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema-engine/sql-migration-tests/tests/migrations/dev_diagnostic_tests.rs b/schema-engine/sql-migration-tests/tests/migrations/dev_diagnostic_tests.rs index ab08bd2b973e..06598bcb2281 100644 --- a/schema-engine/sql-migration-tests/tests/migrations/dev_diagnostic_tests.rs +++ b/schema-engine/sql-migration-tests/tests/migrations/dev_diagnostic_tests.rs @@ -542,7 +542,7 @@ fn drift_can_be_detected_without_migrations_table_dev(api: TestApi) { The following is a summary of the differences between the expected database schema given your migrations files, and the actual schema of the database. - It should be understood as the set of changes to get from the expected schema to the actual schema. + This summary details discrepancies by listing elements found in the current database schema but missing in your Prisma schema, indicating the Prisma schema updates required for alignment. If you are running this the first time on an existing database, please make sure to read this documentation page: https://www.prisma.io/docs/guides/database/developing-with-prisma-migrate/troubleshooting-development @@ -582,7 +582,7 @@ fn drift_detect_first_time_message_should_not_be_dispyed_if_migration_table_exis The following is a summary of the differences between the expected database schema given your migrations files, and the actual schema of the database. - It should be understood as the set of changes to get from the expected schema to the actual schema. + This summary details discrepancies by listing elements found in the current database schema but missing in your Prisma schema, indicating the Prisma schema updates required for alignment. [+] Added tables - cat