From e1d14e57be218fcfbe9a3e9dd4648764c8308b8c Mon Sep 17 00:00:00 2001 From: Jan Piotrowski Date: Tue, 23 Apr 2024 13:50:25 +0000 Subject: [PATCH 1/2] fix(introspection-warnings): Change wording --- schema-engine/connectors/schema-connector/src/warnings.rs | 2 +- .../tests/multi_schema/postgres.rs | 8 ++++---- .../sql-introspection-tests/tests/views/postgresql.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/schema-engine/connectors/schema-connector/src/warnings.rs b/schema-engine/connectors/schema-connector/src/warnings.rs index 3999251b17da..fffff101fff0 100644 --- a/schema-engine/connectors/schema-connector/src/warnings.rs +++ b/schema-engine/connectors/schema-connector/src/warnings.rs @@ -298,7 +298,7 @@ impl fmt::Display for Warnings { )?; render_warnings( - "These items were renamed due to their names being duplicates in the Prisma Schema Language:", + "These items were renamed due to their names being duplicates in this Prisma schema:", &self.duplicate_names, f, )?; diff --git a/schema-engine/sql-introspection-tests/tests/multi_schema/postgres.rs b/schema-engine/sql-introspection-tests/tests/multi_schema/postgres.rs index a32c33cf25d8..de87bd07fe24 100644 --- a/schema-engine/sql-introspection-tests/tests/multi_schema/postgres.rs +++ b/schema-engine/sql-introspection-tests/tests/multi_schema/postgres.rs @@ -195,7 +195,7 @@ async fn multiple_schemas_w_duplicate_table_names_are_introspected(api: &mut Tes let expected = expect![[r#" *** WARNING *** - These items were renamed due to their names being duplicates in the Prisma Schema Language: + These items were renamed due to their names being duplicates in this Prisma schema: - Type: "model", name: "first_A" - Type: "model", name: "second_A" "#]]; @@ -257,7 +257,7 @@ async fn multiple_schemas_w_duplicate_sanitized_table_names_are_introspected(api let expected = expect![[r#" *** WARNING *** - These items were renamed due to their names being duplicates in the Prisma Schema Language: + These items were renamed due to their names being duplicates in this Prisma schema: - Type: "model", name: "first_2A" - Type: "model", name: "second_1A" "#]]; @@ -539,7 +539,7 @@ async fn multiple_schemas_w_duplicate_enums_are_introspected(api: &mut TestApi) let expected = expect![[r#" *** WARNING *** - These items were renamed due to their names being duplicates in the Prisma Schema Language: + These items were renamed due to their names being duplicates in this Prisma schema: - Type: "enum", name: "first_HappyMood" - Type: "enum", name: "second_HappyMood" - Type: "model", name: "first_HappyPerson" @@ -667,7 +667,7 @@ async fn multiple_schemas_w_duplicate_models_are_reintrospected_never_renamed(ap let expected = expect![[r#" *** WARNING *** - These items were renamed due to their names being duplicates in the Prisma Schema Language: + These items were renamed due to their names being duplicates in this Prisma schema: - Type: "model", name: "second_HappyPerson" "#]]; diff --git a/schema-engine/sql-introspection-tests/tests/views/postgresql.rs b/schema-engine/sql-introspection-tests/tests/views/postgresql.rs index 2269ce753c97..f900e544a06a 100644 --- a/schema-engine/sql-introspection-tests/tests/views/postgresql.rs +++ b/schema-engine/sql-introspection-tests/tests/views/postgresql.rs @@ -1099,7 +1099,7 @@ async fn dupes_are_renamed(api: &mut TestApi) -> TestResult { The following views were ignored as they do not have a valid unique identifier or id. This is currently not supported by Prisma Client. Please refer to the documentation on defining unique identifiers in views: https://pris.ly/d/view-identifiers - "public_A" - These items were renamed due to their names being duplicates in the Prisma Schema Language: + These items were renamed due to their names being duplicates in this Prisma schema: - Type: "model", name: "private_A" - Type: "view", name: "public_A" "#]]; From 7a9ecde9c0f26276dc4edad8bd056326f79a35bb Mon Sep 17 00:00:00 2001 From: Jan Piotrowski Date: Mon, 13 May 2024 16:50:48 +0200 Subject: [PATCH 2/2] this => the --- schema-engine/connectors/schema-connector/src/warnings.rs | 2 +- .../tests/multi_schema/postgres.rs | 8 ++++---- .../sql-introspection-tests/tests/views/postgresql.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/schema-engine/connectors/schema-connector/src/warnings.rs b/schema-engine/connectors/schema-connector/src/warnings.rs index fffff101fff0..5744fb40495d 100644 --- a/schema-engine/connectors/schema-connector/src/warnings.rs +++ b/schema-engine/connectors/schema-connector/src/warnings.rs @@ -298,7 +298,7 @@ impl fmt::Display for Warnings { )?; render_warnings( - "These items were renamed due to their names being duplicates in this Prisma schema:", + "These items were renamed due to their names being duplicates in the Prisma schema:", &self.duplicate_names, f, )?; diff --git a/schema-engine/sql-introspection-tests/tests/multi_schema/postgres.rs b/schema-engine/sql-introspection-tests/tests/multi_schema/postgres.rs index de87bd07fe24..b5b073573369 100644 --- a/schema-engine/sql-introspection-tests/tests/multi_schema/postgres.rs +++ b/schema-engine/sql-introspection-tests/tests/multi_schema/postgres.rs @@ -195,7 +195,7 @@ async fn multiple_schemas_w_duplicate_table_names_are_introspected(api: &mut Tes let expected = expect![[r#" *** WARNING *** - These items were renamed due to their names being duplicates in this Prisma schema: + These items were renamed due to their names being duplicates in the Prisma schema: - Type: "model", name: "first_A" - Type: "model", name: "second_A" "#]]; @@ -257,7 +257,7 @@ async fn multiple_schemas_w_duplicate_sanitized_table_names_are_introspected(api let expected = expect![[r#" *** WARNING *** - These items were renamed due to their names being duplicates in this Prisma schema: + These items were renamed due to their names being duplicates in the Prisma schema: - Type: "model", name: "first_2A" - Type: "model", name: "second_1A" "#]]; @@ -539,7 +539,7 @@ async fn multiple_schemas_w_duplicate_enums_are_introspected(api: &mut TestApi) let expected = expect![[r#" *** WARNING *** - These items were renamed due to their names being duplicates in this Prisma schema: + These items were renamed due to their names being duplicates in the Prisma schema: - Type: "enum", name: "first_HappyMood" - Type: "enum", name: "second_HappyMood" - Type: "model", name: "first_HappyPerson" @@ -667,7 +667,7 @@ async fn multiple_schemas_w_duplicate_models_are_reintrospected_never_renamed(ap let expected = expect![[r#" *** WARNING *** - These items were renamed due to their names being duplicates in this Prisma schema: + These items were renamed due to their names being duplicates in the Prisma schema: - Type: "model", name: "second_HappyPerson" "#]]; diff --git a/schema-engine/sql-introspection-tests/tests/views/postgresql.rs b/schema-engine/sql-introspection-tests/tests/views/postgresql.rs index f900e544a06a..b10e5cb51c34 100644 --- a/schema-engine/sql-introspection-tests/tests/views/postgresql.rs +++ b/schema-engine/sql-introspection-tests/tests/views/postgresql.rs @@ -1099,7 +1099,7 @@ async fn dupes_are_renamed(api: &mut TestApi) -> TestResult { The following views were ignored as they do not have a valid unique identifier or id. This is currently not supported by Prisma Client. Please refer to the documentation on defining unique identifiers in views: https://pris.ly/d/view-identifiers - "public_A" - These items were renamed due to their names being duplicates in this Prisma schema: + These items were renamed due to their names being duplicates in the Prisma schema: - Type: "model", name: "private_A" - Type: "view", name: "public_A" "#]];