feat: default datatable fork behavior to keep_original

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Diego Imbert
2026-03-18 12:24:27 +01:00
co-authored by Claude Opus 4.5
parent 96293650f8
commit e8709c3ad0
3 changed files with 6 additions and 6 deletions
@@ -1744,7 +1744,7 @@ async fn fork_resource_datatable(
}
/// Fork all datatables from a source workspace into a target workspace.
/// Uses per-datatable behaviors from the provided map, defaulting to SchemaOnly.
/// Uses per-datatable behaviors from the provided map, defaulting to KeepOriginal.
async fn fork_all_datatables(
db: &DB,
source_workspace_id: &str,
@@ -1776,7 +1776,7 @@ async fn fork_all_datatables(
let behavior = datatable_behaviors
.as_ref()
.and_then(|m| m.get(name).copied())
.unwrap_or(DataTableForkBehavior::SchemaOnly);
.unwrap_or(DataTableForkBehavior::KeepOriginal);
if behavior == DataTableForkBehavior::KeepOriginal {
continue;
+1 -1
View File
@@ -399,7 +399,7 @@ pub enum DataTableForkBehavior {
impl Default for DataTableForkBehavior {
fn default() -> Self {
DataTableForkBehavior::SchemaOnly
DataTableForkBehavior::KeepOriginal
}
}
@@ -189,10 +189,10 @@
return
}
// Build datatable behaviors map, defaulting to schema_only
// Build datatable behaviors map, defaulting to keep_original
const behaviors: Record<string, 'schema_only' | 'schema_and_data' | 'keep_original'> = {}
for (const dt of allDatatables.current ?? []) {
behaviors[dt] = datatableBehaviors[dt] ?? 'schema_only'
behaviors[dt] = datatableBehaviors[dt] ?? 'keep_original'
}
try {
@@ -498,7 +498,7 @@
<Select
dropdownClass="max-w-96"
bind:value={
() => datatableBehaviors[dt] ?? 'schema_only',
() => datatableBehaviors[dt] ?? 'keep_original',
(v) => (datatableBehaviors[dt] = v)
}
items={[