Files
documentdb/internal/pg_documentdb_distributed/sql/udfs/clustermgmt/cluster_operations--latest.sql
T
Shuai Tian d11734352b Merged PR 1548309: [OSS] Migrate schema from helio_api_distributed to documentdb_api_distributed - part2
### Does this PR have any customer impact?

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)

### Are you introducing any new config? If yes, do you have tests with and without them being set?

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description

----
#### AI description  (iteration 1)
#### PR Classification
Schema migration

#### PR Summary
This pull request migrates the schema from `helio_api_distributed` to `documentdb_api_distributed`.
- Updated function definitions in `sql/udfs/clustermgmt/cluster_version_utils--0.21-0.sql` and `cluster_version_utils--latest.sql` to use `__API_SCHEMA_INTERNAL__`.
- Modified function definitions in `sql/udfs/rebalancer/rebalancer_operations--0.24-0.sql` and `rebalancer_operations--latest.sql` to use `__DISTRIBUTED_SCHEMA__`.
- Added schema creation and table initialization in `sql/documentdb_distributed--0.24-0.sql`.
- Updated `Makefile.cflags` and `Makefile` to include `DISTRIBUTED_SCHEMA_NAME` and related configurations.
- Adjusted test and validation scripts to reflect the new schema names.
2025-01-15 07:48:41 +00:00

27 lines
879 B
SQL

CREATE OR REPLACE FUNCTION __API_DISTRIBUTED_SCHEMA__.initialize_cluster()
RETURNS void
SET search_path TO __API_CATALOG_SCHEMA__, pg_catalog
SET citus.enable_ddl_propagation TO on
/*
* By default, Citus triggers are off as there are potential pitfalls if
* not used properly, such as, doing operations on the remote node. We use
* them here only for local operations.
*/
SET citus.enable_unsafe_triggers TO on
SET citus.multi_shard_modify_mode TO 'sequential'
LANGUAGE c
STRICT
AS 'MODULE_PATHNAME', $function$command_initialize_cluster$function$;
CREATE OR REPLACE FUNCTION __API_DISTRIBUTED_SCHEMA__.complete_upgrade()
RETURNS bool
SET citus.enable_unsafe_triggers TO on
SET citus.enable_ddl_propagation TO on
SET citus.multi_shard_modify_mode TO 'sequential'
LANGUAGE c
STRICT
AS 'MODULE_PATHNAME', $function$command_complete_upgrade$function$;