Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions crates/buzz-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3518,16 +3518,25 @@ impl Db {
workflow::delete_workflow(&self.pool, community_id, id).await
}

/// Delete a workflow only when it belongs to the provided owner.
/// Returns the deleted workflow's `channel_id`.
#[datastore_span(name = "delete_workflow_for_owner", system = "postgresql")]
pub async fn delete_workflow_for_owner(
/// Delete a workflow and tombstone its live kind:30620 definition atomically.
///
/// Returns the workflow-row, cache-invalidation, and event-tombstone outcome.
#[datastore_span(name = "delete_workflow_and_definition_for_owner", system = "postgresql")]
pub async fn delete_workflow_and_definition_for_owner(
&self,
community_id: CommunityId,
id: Uuid,
owner_pubkey: &[u8],
) -> Result<Option<Uuid>> {
workflow::delete_workflow_for_owner(&self.pool, community_id, id, owner_pubkey).await
d_tag: &str,
) -> Result<workflow::WorkflowLifecycleDeleteResult> {
workflow::delete_workflow_and_definition_for_owner(
&self.pool,
community_id,
id,
owner_pubkey,
d_tag,
)
.await
}

/// Find a workflow by owner pubkey and name within a community. Used for
Expand Down
Loading