Exemplo n.º 1
0
        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\");");
        }
Exemplo n.º 2
0
        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);");
        }
Exemplo n.º 3
0
        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\");");
        }
Exemplo n.º 4
0
        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\");");
        }
Exemplo n.º 5
0
        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)");
        }
Exemplo n.º 6
0
        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);");
        }
Exemplo n.º 7
0
        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\");");
        }
Exemplo n.º 8
0
        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\");");
        }
Exemplo n.º 9
0
        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);");
        }
Exemplo n.º 10
0
        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\");");
        }
Exemplo n.º 11
0
        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);");
        }
Exemplo n.º 12
0
        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);");
        }