feat(ql3): add cluster legacy env migration plan ledger

This commit is contained in:
whyour
2026-08-24 18:05:06 +08:00
parent 54056e8bab
commit 784d9b21a0
22 changed files with 1843 additions and 56 deletions
@@ -21,8 +21,8 @@ export interface PostgresSchemaContractTrigger {
export interface PostgresSchemaContract {
readonly schema: 'ql3';
readonly contractName: 'control-core';
readonly contractVersion: 68;
readonly migrationId: 'pg-0069-worker-session-management-observation';
readonly contractVersion: 69;
readonly migrationId: 'pg-0070-cluster-legacy-env-migration-plans';
readonly minimumServerMajor: 16;
readonly maximumServerMajor: 18;
readonly capabilities: Readonly<{
@@ -50,6 +50,7 @@ export interface PostgresSchemaContract {
cluster_scheduler_admission: 1;
database_role_grants: 1;
cluster_execution_revision: 1;
cluster_legacy_env_migration_plan: 1;
identity_admin: 1;
plugin_package_admission: 1;
plugin_package_authority_split: 1;
@@ -122,8 +123,8 @@ export const postgresqlControlSchemaContract: PostgresSchemaContract =
Object.freeze({
schema: 'ql3',
contractName: 'control-core',
contractVersion: 68,
migrationId: 'pg-0069-worker-session-management-observation',
contractVersion: 69,
migrationId: 'pg-0070-cluster-legacy-env-migration-plans',
minimumServerMajor: 16,
maximumServerMajor: 18,
capabilities: Object.freeze({
@@ -137,6 +138,7 @@ export const postgresqlControlSchemaContract: PostgresSchemaContract =
automation_management_boundary: 1,
automation_management_identity_keyset_ledger: 1,
cluster_execution_revision: 1,
cluster_legacy_env_migration_plan: 1,
cluster_recovery: 1,
cluster_recovery_claim: 1,
cluster_scheduler_admission: 1,
@@ -228,6 +230,27 @@ export const postgresqlControlSchemaContract: PostgresSchemaContract =
'created_at_ms',
'updated_at_ms',
]),
table('cluster_legacy_env_migration_plans', [
'plan_id',
'mutation_id',
'project_id',
'plan_digest',
'reconciliation_bundle_digest',
'decision_digest',
'candidate_set_digest',
'source_row_count',
'active_row_count',
'disabled_row_count',
'effective_binding_count',
'secret_ref',
'task_revision_set_digest',
'trigger_revision_set_digest',
'task_count',
'trigger_count',
'total_effective_bytes',
'planned_at_ms',
'plan_json',
]),
table('plugin_package_installs', [
'installation_id',
'project_id',
@@ -1539,6 +1562,10 @@ export const postgresqlControlSchemaContract: PostgresSchemaContract =
'schema_capabilities_pkey',
'projects_pkey',
'ql3_projects_slug_uidx',
'cluster_legacy_env_migration_plans_pkey',
'ql3_cluster_legacy_env_plan_mutation_uidx',
'ql3_cluster_legacy_env_plan_digest_uidx',
'ql3_cluster_legacy_env_plan_project_idx',
'plugin_package_installs_pkey',
'ql3_plugin_package_installs_quarantine_target_key',
'ql3_plugin_package_installs_recovery_idx',
@@ -1863,6 +1890,12 @@ export const postgresqlControlSchemaContract: PostgresSchemaContract =
'ql3_projects_version_check',
'ql3_projects_created_at_check',
'ql3_projects_updated_at_check',
'ql3_cluster_legacy_env_plan_identity_check',
'ql3_cluster_legacy_env_plan_digest_check',
'ql3_cluster_legacy_env_plan_source_check',
'ql3_cluster_legacy_env_plan_target_check',
'ql3_cluster_legacy_env_plan_time_check',
'ql3_cluster_legacy_env_plan_json_check',
'ql3_plugin_package_installs_identity_check',
'ql3_plugin_package_installs_operation_check',
'ql3_plugin_package_installs_state_check',
@@ -2342,6 +2375,7 @@ export const postgresqlControlSchemaContract: PostgresSchemaContract =
]),
foreignKeys: Object.freeze([
'ql3_schema_capabilities_migration_fk',
'ql3_cluster_legacy_env_plan_project_fk',
'ql3_plugin_package_installs_project_fk',
'ql3_plugin_package_install_heads_project_fk',
'ql3_plugin_package_install_heads_install_fk',