public void generate_ddl_other_database_schema_for_single_column_unique() { var definition = new IndexDefinition(mappingOhterSchema, "foo"); definition.IsUnique = true; definition.ToDDL() .ShouldBe("CREATE UNIQUE INDEX mt_doc_target_idx_foo ON other.mt_doc_target (\"foo\");"); }
public void generate_ddl_for_custom_index_name() { var definition = new IndexDefinition(mapping, "foo"); definition.IndexName = "bar"; definition.ToDDL() .ShouldBe("CREATE INDEX mt_bar ON public.mt_doc_target (\"foo\");"); }
public void generate_ddl_for_single_column_unique() { var definition = new IndexDefinition(mapping, "foo"); definition.IsUnique = true; definition.ToDDL() .ShouldBe("CREATE UNIQUE INDEX mt_doc_target_idx_foo ON public.mt_doc_target (\"foo\");"); }
public void generate_ddl_for_concurrent_index() { var definition = new IndexDefinition(mapping, "foo"); definition.IsConcurrent = true; definition.ToDDL() .ShouldBe("CREATE INDEX CONCURRENTLY mt_doc_target_idx_foo ON mt_doc_target (foo);"); }
public void generate_ddl_for_gin_index() { var definition = new IndexDefinition(mapping, "foo"); definition.Method = IndexMethod.gin; definition.ToDDL() .ShouldBe("CREATE INDEX mt_doc_target_idx_foo ON mt_doc_target USING gin (foo)"); }
public void generate_ddl_with_modifier() { var definition = new IndexDefinition(mapping, "foo"); definition.IsUnique = true; definition.Modifier = "WITH (fillfactor = 70)"; definition.ToDDL() .ShouldBe("CREATE UNIQUE INDEX mt_doc_target_idx_foo ON mt_doc_target (foo) WITH (fillfactor = 70);"); }
public void generate_ddl_on_other_database_schema_for_hash_index() { var definition = new IndexDefinition(mappingOhterSchema, "foo"); definition.Method = IndexMethod.hash; definition.ToDDL() .ShouldBe("CREATE INDEX mt_doc_target_idx_foo ON other.mt_doc_target USING hash (\"foo\");"); }
public void generate_ddl_for_hash_index() { var definition = new IndexDefinition(mapping, "foo"); definition.Method = IndexMethod.hash; definition.ToDDL() .ShouldBe("CREATE INDEX mt_doc_target_idx_foo ON public.mt_doc_target USING hash (\"foo\");"); }
public void generate_ddl_other_database_schema_for_gin_with_jsonb_path_ops_index() { var definition = new IndexDefinition(mappingOhterSchema, "foo"); definition.Method = IndexMethod.gin; definition.Expression = "? jsonb_path_ops"; definition.ToDDL() .ShouldBe("CREATE INDEX mt_doc_target_idx_foo ON other.mt_doc_target USING gin (\"foo\" jsonb_path_ops);"); }
public void generate_ddl_other_database_schema_for_concurrent_unique_index() { var definition = new IndexDefinition(mappingOhterSchema, "foo"); definition.IsConcurrent = true; definition.IsUnique = true; definition.ToDDL() .ShouldBe("CREATE UNIQUE INDEX CONCURRENTLY mt_doc_target_idx_foo ON other.mt_doc_target (\"foo\");"); }
public void generate_ddl_other_database_schema_with_modifier() { var definition = new IndexDefinition(mappingOhterSchema, "foo"); definition.IsUnique = true; definition.Modifier = "WITH (fillfactor = 70)"; definition.ToDDL() .ShouldBe("CREATE UNIQUE INDEX mt_doc_target_idx_foo ON other.mt_doc_target (\"foo\") WITH (fillfactor = 70);"); }
public void generate_ddl_for_gin_with_jsonb_path_ops_index() { var definition = new IndexDefinition(mapping, "foo"); definition.Method = IndexMethod.gin; definition.Expression = "? jsonb_path_ops"; definition.ToDDL() .ShouldBe("CREATE INDEX mt_doc_target_idx_foo ON mt_doc_target USING gin (foo jsonb_path_ops);"); }