From 10ab90b07c41829efe4f9915172c64ce29efc352 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Thu, 12 Mar 2026 15:47:07 +0100 Subject: [PATCH] remove fork_datatable route --- .../windmill-api-workspaces/src/workspaces.rs | 31 ++-------------- backend/windmill-api/openapi.yaml | 35 ------------------- 2 files changed, 2 insertions(+), 64 deletions(-) diff --git a/backend/windmill-api-workspaces/src/workspaces.rs b/backend/windmill-api-workspaces/src/workspaces.rs index 19fe03b9c0..670cb76049 100644 --- a/backend/windmill-api-workspaces/src/workspaces.rs +++ b/backend/windmill-api-workspaces/src/workspaces.rs @@ -111,7 +111,6 @@ pub fn workspaced_service() -> Router { .route("/list_datatables", get(list_datatables)) .route("/list_datatable_schemas", get(list_datatable_schemas)) .route("/edit_datatable_config", post(edit_datatable_config)) - .route("/fork_datatable", post(fork_datatable)) .route("/edit_git_sync_config", post(edit_git_sync_config)) .route("/edit_git_sync_repository", post(edit_git_sync_repository)) .route( @@ -1378,37 +1377,11 @@ pub async fn dump_datatable( Ok(dump) } -#[derive(Deserialize)] -struct ForkDatatableRequest { - source_datatable_name: String, - new_datatable_name: String, - new_custom_instance_database_name: String, - #[serde(default)] - include_data: bool, -} - -async fn fork_datatable( - authed: ApiAuthed, - Extension(db): Extension, - Path(w_id): Path, - Json(req): Json, -) -> Result { - require_super_admin(&db, &authed.email).await?; - fork_datatable_inner( - &db, - &w_id, - &req.source_datatable_name, - &req.new_datatable_name, - &req.new_custom_instance_database_name, - req.include_data, - ) - .await -} /// Core logic for forking a single datatable: creates a new instance DB, /// dumps the source schema (and optionally data), imports into the new DB, /// and updates the target workspace's datatable config. -async fn fork_datatable_inner( +async fn fork_datatable( db: &DB, w_id: &str, source_datatable_name: &str, @@ -1560,7 +1533,7 @@ async fn fork_all_datatables( "__wmfork__{}__$current_name", target_workspace_id.replace('-', "_") ); - if let Err(e) = fork_datatable_inner( + if let Err(e) = fork_datatable( db, target_workspace_id, name, diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 4694459f46..ebcd0ad820 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -3333,41 +3333,6 @@ paths: application/json: schema: {} - /w/{workspace}/workspaces/fork_datatable: - post: - summary: fork a datatable to a new workspace - operationId: forkDatatable - tags: - - workspace - parameters: - - $ref: "#/components/parameters/WorkspaceId" - requestBody: - description: Fork datatable request - required: true - content: - application/json: - schema: - type: object - required: [source_datatable_name, new_datatable_name, new_custom_instance_database_name] - properties: - source_datatable_name: - type: string - new_datatable_name: - type: string - new_custom_instance_database_name: - type: string - description: "Name for the new database. Use $current_name to interpolate the original database name." - include_data: - type: boolean - default: false - description: "If true, fork both schema and data. If false (default), fork schema only." - responses: - "200": - description: status - content: - application/json: - schema: {} - /w/{workspace}/workspaces/edit_git_sync_config: post: summary: edit workspace git sync settings