feat: 迁移 PostgreSQL registry 所有权存储与恢复测试
Verify / database-integration (pull_request) Failing after 14m6s
Verify / test (pull_request) Successful in 6m46s
Verify / lint (pull_request) Successful in 7m48s

This commit is contained in:
2026-09-21 09:01:05 +00:00
parent c110aceb0f
commit f6d552f944
8 changed files with 919 additions and 18 deletions
@@ -0,0 +1,25 @@
CREATE SCHEMA postgresql_tenant_operator;
CREATE TABLE postgresql_tenant_operator.tenant_ownership (
instance_uid text NOT NULL,
tenant_uid text NOT NULL,
tenant_namespace text NOT NULL,
tenant_name text NOT NULL,
database_name text NOT NULL,
role_name text NOT NULL,
credential_path text NOT NULL,
managed boolean NOT NULL DEFAULT true,
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
updated_at timestamptz NOT NULL DEFAULT clock_timestamp(),
retained_at timestamptz,
PRIMARY KEY (instance_uid, tenant_uid),
UNIQUE (instance_uid, tenant_namespace, tenant_name),
UNIQUE (instance_uid, database_name),
UNIQUE (instance_uid, role_name),
UNIQUE (credential_path),
CHECK (managed OR retained_at IS NOT NULL)
);
---- create above / drop below ----
DROP SCHEMA postgresql_tenant_operator CASCADE;