Files
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

17 lines
756 B
SQL

CREATE SCHEMA documentdb_api_distributed;
GRANT USAGE ON SCHEMA documentdb_api_distributed TO __API_ADMIN_ROLE__;
GRANT USAGE ON SCHEMA documentdb_api_distributed TO __API_READONLY_ROLE__;
CREATE TABLE documentdb_api_distributed.documentdb_cluster_data
(
metadata __CORE_SCHEMA__.bson
);
-- seed the table with a baseline version.
INSERT INTO documentdb_api_distributed.documentdb_cluster_data (metadata) VALUES ( '{ "last_deploy_version": "0.0-0" }'::__CORE_SCHEMA__.bson );
#include "udfs/clustermgmt/cluster_operations--0.21-0.sql"
#include "udfs/clustermgmt/cluster_version_utils--0.21-0.sql"
ALTER TABLE documentdb_api_distributed.documentdb_cluster_data ADD PRIMARY KEY (metadata);
#include "udfs/rebalancer/rebalancer_operations--0.24-0.sql"