From bc8954a544dd7c7b18a3eb9ee939e09d30bb900b Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Mon, 30 Sep 2024 15:22:14 +0100 Subject: [PATCH] materialize-sql: update test snapshots --- materialize-mysql/sqlgen.go | 2 +- materialize-postgres/sqlgen.go | 2 +- .../.snapshots/TestValidateMigrations | 18 ++++++++++++++++++ materialize-sqlserver/sqlgen.go | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/materialize-mysql/sqlgen.go b/materialize-mysql/sqlgen.go index a7c18559d..0e3db7615 100644 --- a/materialize-mysql/sqlgen.go +++ b/materialize-mysql/sqlgen.go @@ -221,7 +221,7 @@ ALTER TABLE {{$.Identifier}} {{- if $ind }},{{ end }} MODIFY {{ ColumnIdentifier $col.Name }} {{$col.Type}} {{- end }}; -{{- end -}} +{{- end }} {{ end }} -- Templated creation of a temporary load table: diff --git a/materialize-postgres/sqlgen.go b/materialize-postgres/sqlgen.go index c162922fa..208c43576 100644 --- a/materialize-postgres/sqlgen.go +++ b/materialize-postgres/sqlgen.go @@ -134,7 +134,7 @@ ALTER TABLE {{$.Identifier}} {{- if $ind }},{{ end }} ALTER COLUMN {{ ColumnIdentifier $col.Name }} DROP NOT NULL {{- end }}; -{{- end -}} +{{- end }} {{ end }} -- Templated creation of a temporary load table: diff --git a/materialize-sql/.snapshots/TestValidateMigrations b/materialize-sql/.snapshots/TestValidateMigrations index eed4971b1..62c7bfe09 100644 --- a/materialize-sql/.snapshots/TestValidateMigrations +++ b/materialize-sql/.snapshots/TestValidateMigrations @@ -1,5 +1,9 @@ new materialization - standard updates: {"Field":"_meta/flow_truncated","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} +{"Field":"dateString","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} +{"Field":"dateValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} +{"Field":"datetimeString","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} +{"Field":"datetimeValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} {"Field":"flow_document","Type":2,"TypeString":"LOCATION_REQUIRED","Reason":"The root document is required for a standard updates materialization"} {"Field":"flow_published_at","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} {"Field":"key","Type":2,"TypeString":"LOCATION_REQUIRED","Reason":"All Locations that are part of the collections key are required"} @@ -10,9 +14,15 @@ new materialization - standard updates: {"Field":"optional","Type":4,"TypeString":"FIELD_OPTIONAL","Reason":"This field is able to be materialized"} {"Field":"scalarValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} {"Field":"second_root","Type":5,"TypeString":"FIELD_FORBIDDEN","Reason":"Only a single root document projection can be materialized for standard updates"} +{"Field":"timeString","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} +{"Field":"timeValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} same binding again - standard updates: {"Field":"_meta/flow_truncated","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} +{"Field":"dateString","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} +{"Field":"dateValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} +{"Field":"datetimeString","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} +{"Field":"datetimeValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} {"Field":"flow_document","Type":1,"TypeString":"FIELD_REQUIRED","Reason":"This field is the document in the current materialization"} {"Field":"flow_published_at","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} {"Field":"key","Type":1,"TypeString":"FIELD_REQUIRED","Reason":"This field is a key in the current materialization"} @@ -23,9 +33,15 @@ same binding again - standard updates: {"Field":"optional","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} {"Field":"scalarValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} {"Field":"second_root","Type":5,"TypeString":"FIELD_FORBIDDEN","Reason":"Cannot materialize root document projection 'second_root' because field 'flow_document' is already being materialized as the document"} +{"Field":"timeString","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} +{"Field":"timeValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} binding update with migratable changes: {"Field":"_meta/flow_truncated","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"} +{"Field":"dateString","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} +{"Field":"dateValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} +{"Field":"datetimeString","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} +{"Field":"datetimeValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} {"Field":"flow_document","Type":1,"TypeString":"FIELD_REQUIRED","Reason":"This field is the document in the current materialization"} {"Field":"flow_published_at","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} {"Field":"key","Type":1,"TypeString":"FIELD_REQUIRED","Reason":"This field is a key in the current materialization"} @@ -36,5 +52,7 @@ binding update with migratable changes: {"Field":"optional","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} {"Field":"scalarValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} {"Field":"second_root","Type":5,"TypeString":"FIELD_FORBIDDEN","Reason":"Cannot materialize root document projection 'second_root' because field 'flow_document' is already being materialized as the document"} +{"Field":"timeString","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} +{"Field":"timeValue","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"} diff --git a/materialize-sqlserver/sqlgen.go b/materialize-sqlserver/sqlgen.go index 9d04da9e2..0cd557c6f 100644 --- a/materialize-sqlserver/sqlgen.go +++ b/materialize-sqlserver/sqlgen.go @@ -202,7 +202,7 @@ ALTER TABLE {{$.Identifier}} ADD {{- if $ind }},{{ end }} {{$col.Identifier}} {{$col.NullableDDL}} {{- end }}; -{{- end -}} +{{- end }} {{ end }} -- Templated creation of a temporary load table: