copy profile to another server1

This commit is contained in:
Priec
2026-09-03 19:21:54 +02:00
parent cfb3bde02e
commit 05c387406c
7 changed files with 454 additions and 2 deletions

View File

@@ -55,6 +55,17 @@ service TableDefinition {
// Copies one complete profile into a new profile without copying table data.
rpc CopyProfile(CopyProfileRequest) returns (CopyProfileResponse);
// Serializes selected table structure and every required structural dependency.
// Dynamic table rows and deployment-local security state are never included.
rpc ExportProfileBlueprint(ExportProfileBlueprintRequest) returns (ExportProfileBlueprintResponse);
// Reconciles a portable blueprint against a destination profile without writing.
rpc PlanProfileBlueprintImport(PlanProfileBlueprintImportRequest) returns (PlanProfileBlueprintImportResponse);
// Applies a previously reviewed blueprint plan atomically. The plan hash protects
// against both a changed package and destination drift between preview and apply.
rpc ImportProfileBlueprint(ImportProfileBlueprintRequest) returns (ImportProfileBlueprintResponse);
// Returns the unified append-only history for column and option aliases.
rpc GetAliasChangeHistory(GetAliasChangeHistoryRequest) returns (GetAliasChangeHistoryResponse);
@@ -482,6 +493,56 @@ message CopyProfileResponse {
int32 scripts_copied = 4;
}
message ExportProfileBlueprintRequest {
string profile_name = 1;
// Empty exports every dynamic table in the profile. Otherwise only these tables
// are created by import; their unselected local dependencies become requirements.
repeated string table_names = 2;
}
message ExportProfileBlueprintResponse {
string blueprint_json = 1;
string blueprint_sha256 = 2;
int32 tables = 3;
int32 required_local_tables = 4;
int32 required_global_tables = 5;
int32 templates = 6;
}
message PlanProfileBlueprintImportRequest {
string target_profile_name = 1;
string blueprint_json = 2;
}
message ProfileBlueprintImportAction {
// One of create, reuse, add, or conflict.
string action = 1;
string resource = 2;
string detail = 3;
}
message PlanProfileBlueprintImportResponse {
bool can_import = 1;
string plan_sha256 = 2;
repeated ProfileBlueprintImportAction actions = 3;
}
message ImportProfileBlueprintRequest {
string target_profile_name = 1;
string blueprint_json = 2;
string expected_plan_sha256 = 3;
}
message ImportProfileBlueprintResponse {
bool success = 1;
string message = 2;
int32 tables_created = 3;
int32 globals_created = 4;
int32 globals_reused = 5;
int32 templates_created = 6;
int32 templates_reused = 7;
}
enum AliasChangeKind {
ALIAS_CHANGE_KIND_UNSPECIFIED = 0;
ALIAS_CHANGE_KIND_COLUMN = 1;