Add SpacetimeDB conflict migration flow
This commit is contained in:
@@ -40,6 +40,7 @@ try {
|
||||
`[spacetime:migration:import] ${options.dryRun ? 'dry-run 完成' : '导入完成'}: ${inPath}`,
|
||||
);
|
||||
printTableStats(result.table_stats);
|
||||
printMigrationWarnings(result.warnings);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`[spacetime:migration:import] ${error instanceof Error ? error.message : String(error)}`,
|
||||
@@ -177,3 +178,18 @@ function printTableStats(tableStats) {
|
||||
}));
|
||||
console.table(rows);
|
||||
}
|
||||
|
||||
function printMigrationWarnings(warnings) {
|
||||
if (!Array.isArray(warnings) || warnings.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.warn('[spacetime:migration:import] 迁移告警汇总:');
|
||||
console.table(
|
||||
warnings.map((warning) => ({
|
||||
table: warning.table_name,
|
||||
kind: warning.warning_kind,
|
||||
message: warning.message,
|
||||
})),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user