diff --git a/SQLSchemaCompare.Infrastructure/SqlScripters/PostgreSqlScripter.cs b/SQLSchemaCompare.Infrastructure/SqlScripters/PostgreSqlScripter.cs index 74be107..040b749 100644 --- a/SQLSchemaCompare.Infrastructure/SqlScripters/PostgreSqlScripter.cs +++ b/SQLSchemaCompare.Infrastructure/SqlScripters/PostgreSqlScripter.cs @@ -321,12 +321,12 @@ protected override string ScriptCreateIndex(ABaseDbIndex index) // If not specified it will use the BTREE break; - case "gist": - sb.Append("USING gist "); - break; - case "hash": - sb.Append("USING hash "); + case "gist": + case "spgist": + case "gin": + case "brin": + sb.Append($"USING {indexPostgreSql.Type} "); break; default: diff --git a/SQLSchemaCompare.Test/Datasources/sakila-schema-postgresql.sql b/SQLSchemaCompare.Test/Datasources/sakila-schema-postgresql.sql index c9ac870..9aca16f 100644 --- a/SQLSchemaCompare.Test/Datasources/sakila-schema-postgresql.sql +++ b/SQLSchemaCompare.Test/Datasources/sakila-schema-postgresql.sql @@ -1322,7 +1322,7 @@ CREATE INDEX film_fulltext_idx ON inventory.film USING gist (fulltext); -- Name: idx_actor_last_name; Type: INDEX; Schema: public; Owner: postgres -- -CREATE INDEX idx_actor_last_name ON inventory.actor USING btree (last_name); +CREATE INDEX idx_actor_last_name ON inventory.actor USING brin (last_name); -- @@ -1483,7 +1483,7 @@ CREATE INDEX idx_fk_store_id ON customer_data.customer USING btree (store_id); -- Name: idx_last_name; Type: INDEX; Schema: public; Owner: postgres -- -CREATE INDEX idx_last_name ON customer_data.customer USING btree (last_name); +CREATE INDEX idx_last_name ON customer_data.customer USING SPGIST (last_name); -- @@ -1500,6 +1500,13 @@ CREATE INDEX idx_store_id_film_id ON inventory USING btree (store_id, film_id); CREATE INDEX idx_title ON inventory.film USING btree (title); +-- +-- Name: idx_special_features; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX idx_special_features ON inventory.film USING gin (special_features); + + -- -- Name: idx_unq_manager_staff_id; Type: INDEX; Schema: public; Owner: postgres --