Пример #1
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\");");
        }
Пример #2
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\");");
        }
Пример #3
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\");");
        }
Пример #4
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);");
        }
Пример #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)");
        }
Пример #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);");
        }
Пример #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\");");
        }
Пример #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\");");
        }
Пример #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);");
        }
Пример #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\");");
        }
Пример #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);");
        }
Пример #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);");
        }