From 9d763ba244de3e358064f2cda5d3ecd93508ccda Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sat, 14 Nov 2026 16:12:45 +0000 Subject: [PATCH 1/9] Reproduce retained payload loss after native storage policy changes --- rust/tests/execution/external_payloads.rs | 2 + .../external_payloads/policy_changes.rs | 85 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 rust/tests/execution/external_payloads/policy_changes.rs diff --git a/rust/tests/execution/external_payloads.rs b/rust/tests/execution/external_payloads.rs index 1bedc844e..9fbb28249 100644 --- a/rust/tests/execution/external_payloads.rs +++ b/rust/tests/execution/external_payloads.rs @@ -15,6 +15,8 @@ mod retention; mod namespace_delete; #[path = "external_payloads/carried_polls.rs"] mod carried_polls; +#[path = "external_payloads/policy_changes.rs"] +mod policy_changes; use axum::{body::Bytes, http::HeaderMap}; use durable_workflow_server::runtime::ExternalPayloadConfig; use sha2::{Digest, Sha256}; diff --git a/rust/tests/execution/external_payloads/policy_changes.rs b/rust/tests/execution/external_payloads/policy_changes.rs new file mode 100644 index 000000000..c19a7d541 --- /dev/null +++ b/rust/tests/execution/external_payloads/policy_changes.rs @@ -0,0 +1,85 @@ +use super::*; +use super::retention::{closed_run, ns_request, object, registered, upload}; + +async fn fetch(router: &Router, namespace: &str, reference: &Value) -> (StatusCode, Value) { + let (status, _, bytes) = request(router, "GET", + &format!("/api/external-payloads/v1/{}", reference["reference_id"].as_str().unwrap()), + "worker-token", namespace, Some(reference), Body::empty()).await; + if status == StatusCode::OK { + assert_eq!(digest(&bytes), reference["sha256"].as_str().unwrap()); + assert_eq!(bytes.len() as i64, reference["size_bytes"].as_i64().unwrap()); + (status, Value::Null) + } else { + (status, serde_json::from_slice(&bytes).unwrap()) + } +} + +#[tokio::test] +async fn disabling_new_offloads_keeps_retained_reads_and_pruning_available() { + let temporary = tempfile::tempdir().unwrap(); + let root = temporary.path().join("objects"); + let (database, runtime, router) = setup(ExternalPayloadConfig::default(), &root).await; + let reference = upload(&router, "default", "retained after disabling").await; + let run = closed_run(&router, "default", "disabled-retained", &reference).await; + // A disable request need not repeat the backing location. + let (status, body) = ns_request(&router, "PUT", "/api/namespaces/default/external-storage", "default", + json!({"driver":"local", "enabled":false})).await; + assert_eq!(status, StatusCode::OK, "{body}"); + assert_eq!(body["external_payload_storage"]["config"]["uri"], format!("file://{}", root.display())); + assert_eq!(fetch(&router, "default", &reference).await.0, StatusCode::OK); + let new_bytes = b"a new upload must remain disabled"; + let (status, _, _) = request(&router, "POST", "/api/external-payloads/v1", "worker-token", "default", + Some(&metadata(new_bytes)), Body::from(new_bytes.as_slice())).await; + assert_eq!(status, StatusCode::SERVICE_UNAVAILABLE); + let (status, body) = ns_request(&router, "POST", "/api/system/retention/pass", "default", json!({"run_ids":[run]})).await; + assert_eq!(status, StatusCode::OK, "{body}"); + assert_eq!(body["results"][0]["outcome"], "pruned", "{body}"); + assert_eq!(body["results"][0]["external_payloads_deleted"], 1); + assert!(!object(&root, &reference).exists()); + assert_eq!(registered(&database, &reference).await, 0); + runtime.close().await; + database.remove().await; +} + +#[tokio::test] +async fn a_location_change_is_refused_until_registered_objects_are_released() { + let temporary = tempfile::tempdir().unwrap(); + let root = temporary.path().join("original"); + let next = temporary.path().join("replacement"); + let (database, runtime, router) = setup(ExternalPayloadConfig::default(), &root).await; + let reference = upload(&router, "default", "keep the original location").await; + let run = closed_run(&router, "default", "policy-location", &reference).await; + let (status, body) = ns_request(&router, "PUT", "/api/namespaces/default/external-storage", "default", + json!({"driver":"local","enabled":true,"config":{"uri":format!("file://{}", next.display())}})).await; + assert_eq!(status, StatusCode::CONFLICT, "{body}"); + assert_eq!(body["reason"], "external_payload_storage_in_use"); + assert!(!next.exists(), "a refused configuration creates no backing directory"); + assert_eq!(fetch(&router, "default", &reference).await.0, StatusCode::OK); + let (status, body) = ns_request(&router, "POST", "/api/system/retention/pass", "default", json!({"run_ids":[run]})).await; + assert_eq!(status, StatusCode::OK, "{body}"); + assert_eq!(body["results"][0]["outcome"], "pruned", "{body}"); + assert_eq!(policy(&router, "default", &next, true).await, StatusCode::OK); + let replacement = upload(&router, "default", "the next location").await; + assert!(object(&next, &replacement).exists()); + assert!(!object(&root, &replacement).exists()); + runtime.close().await; + database.remove().await; +} + +#[tokio::test] +async fn disabled_storage_still_allows_namespace_deletion() { + let temporary = tempfile::tempdir().unwrap(); + let root = temporary.path().join("objects"); + let (database, runtime, router) = setup(ExternalPayloadConfig::default(), &root).await; + assert_eq!(ns_request(&router, "POST", "/api/namespaces", "default", json!({"name":"disabled-delete"})).await.0, StatusCode::CREATED); + assert_eq!(policy(&router, "disabled-delete", &root, true).await, StatusCode::OK); + let reference = upload(&router, "disabled-delete", "delete while disabled").await; + closed_run(&router, "disabled-delete", "disabled-delete-run", &reference).await; + assert_eq!(policy(&router, "disabled-delete", &root, false).await, StatusCode::OK); + let (status, body) = ns_request(&router, "DELETE", "/api/namespaces/disabled-delete", "default", Value::Null).await; + assert_eq!(status, StatusCode::OK, "{body}"); + assert!(!object(&root, &reference).exists()); + assert_eq!(registered(&database, &reference).await, 0); + runtime.close().await; + database.remove().await; +} From 7f86eeb8032aee2075817aa1d32fcee746d7ff23 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sat, 14 Nov 2026 16:48:31 +0000 Subject: [PATCH 2/9] Require immutable per-object bindings across successful policy moves --- .../external_payloads/policy_changes.rs | 174 ++++++++++++++---- 1 file changed, 138 insertions(+), 36 deletions(-) diff --git a/rust/tests/execution/external_payloads/policy_changes.rs b/rust/tests/execution/external_payloads/policy_changes.rs index c19a7d541..b48a42e52 100644 --- a/rust/tests/execution/external_payloads/policy_changes.rs +++ b/rust/tests/execution/external_payloads/policy_changes.rs @@ -14,6 +14,46 @@ async fn fetch(router: &Router, namespace: &str, reference: &Value) -> (StatusCo } } +async fn prune(router: &Router, run: &str) -> Value { + let (status, body) = ns_request(router, "POST", "/api/system/retention/pass", "default", json!({"run_ids":[run]})).await; + assert_eq!(status, StatusCode::OK, "{body}"); + assert_eq!(body["results"][0]["outcome"], "pruned", "{body}"); + body["results"][0].clone() +} + +async fn binding(database: &TestDatabase, reference: &Value) -> Value { + let rows = text_rows(database, + "SELECT id,storage_binding FROM runtime_external_payloads ORDER BY id", + "SELECT id,storage_binding FROM runtime_external_payloads ORDER BY id", + "SELECT id,storage_binding FROM runtime_external_payloads ORDER BY id").await; + let stored = &rows.iter().find(|(id,_)| id==reference["reference_id"].as_str().unwrap()).unwrap().1; + serde_json::from_str(stored).unwrap() +} + +async fn replace_binding(database: &TestDatabase, reference: &Value, value: &Value) { + let id = reference["reference_id"].as_str().unwrap(); + match database { + TestDatabase::Sqlite(directory) => { + let pool = sqlx::SqlitePool::connect(&format!("sqlite://{}", directory.path().join("runtime.sqlite").display())).await.unwrap(); + sqlx::query("UPDATE runtime_external_payloads SET storage_binding=$1 WHERE id=$2") + .bind(value.to_string()).bind(id).execute(&pool).await.unwrap(); + pool.close().await; + } + TestDatabase::Postgres { options, .. } => { + let pool = sqlx::postgres::PgPoolOptions::new().connect_with(options.as_ref().clone()).await.unwrap(); + sqlx::query("UPDATE runtime_external_payloads SET storage_binding=$1 WHERE id=$2") + .bind(value.to_string()).bind(id).execute(&pool).await.unwrap(); + pool.close().await; + } + TestDatabase::MySql { options, .. } => { + let pool = sqlx::mysql::MySqlPoolOptions::new().connect_with(options.as_ref().clone()).await.unwrap(); + sqlx::query("UPDATE runtime_external_payloads SET storage_binding=? WHERE id=?") + .bind(value.to_string()).bind(id).execute(&pool).await.unwrap(); + pool.close().await; + } + } +} + #[tokio::test] async fn disabling_new_offloads_keeps_retained_reads_and_pruning_available() { let temporary = tempfile::tempdir().unwrap(); @@ -21,20 +61,18 @@ async fn disabling_new_offloads_keeps_retained_reads_and_pruning_available() { let (database, runtime, router) = setup(ExternalPayloadConfig::default(), &root).await; let reference = upload(&router, "default", "retained after disabling").await; let run = closed_run(&router, "default", "disabled-retained", &reference).await; - // A disable request need not repeat the backing location. let (status, body) = ns_request(&router, "PUT", "/api/namespaces/default/external-storage", "default", json!({"driver":"local", "enabled":false})).await; assert_eq!(status, StatusCode::OK, "{body}"); assert_eq!(body["external_payload_storage"]["config"]["uri"], format!("file://{}", root.display())); assert_eq!(fetch(&router, "default", &reference).await.0, StatusCode::OK); + let later = closed_run(&router, "default", "disabled-existing-input", &reference).await; let new_bytes = b"a new upload must remain disabled"; let (status, _, _) = request(&router, "POST", "/api/external-payloads/v1", "worker-token", "default", Some(&metadata(new_bytes)), Body::from(new_bytes.as_slice())).await; assert_eq!(status, StatusCode::SERVICE_UNAVAILABLE); - let (status, body) = ns_request(&router, "POST", "/api/system/retention/pass", "default", json!({"run_ids":[run]})).await; - assert_eq!(status, StatusCode::OK, "{body}"); - assert_eq!(body["results"][0]["outcome"], "pruned", "{body}"); - assert_eq!(body["results"][0]["external_payloads_deleted"], 1); + assert_eq!(prune(&router, &run).await["external_payloads_deleted"], 0); + assert_eq!(prune(&router, &later).await["external_payloads_deleted"], 1); assert!(!object(&root, &reference).exists()); assert_eq!(registered(&database, &reference).await, 0); runtime.close().await; @@ -42,44 +80,108 @@ async fn disabling_new_offloads_keeps_retained_reads_and_pruning_available() { } #[tokio::test] -async fn a_location_change_is_refused_until_registered_objects_are_released() { +async fn moving_the_write_policy_keeps_both_generations_bound_across_cold_read_and_mixed_prune() { let temporary = tempfile::tempdir().unwrap(); - let root = temporary.path().join("original"); - let next = temporary.path().join("replacement"); - let (database, runtime, router) = setup(ExternalPayloadConfig::default(), &root).await; - let reference = upload(&router, "default", "keep the original location").await; - let run = closed_run(&router, "default", "policy-location", &reference).await; - let (status, body) = ns_request(&router, "PUT", "/api/namespaces/default/external-storage", "default", - json!({"driver":"local","enabled":true,"config":{"uri":format!("file://{}", next.display())}})).await; - assert_eq!(status, StatusCode::CONFLICT, "{body}"); - assert_eq!(body["reason"], "external_payload_storage_in_use"); - assert!(!next.exists(), "a refused configuration creates no backing directory"); - assert_eq!(fetch(&router, "default", &reference).await.0, StatusCode::OK); - let (status, body) = ns_request(&router, "POST", "/api/system/retention/pass", "default", json!({"run_ids":[run]})).await; + let original = temporary.path().join("original"); + let replacement = temporary.path().join("replacement"); + let (database, runtime, app) = setup(ExternalPayloadConfig::default(), &original).await; + let first = upload(&app, "default", "original input").await; + let (status, started) = ns_request(&app, "POST", "/api/workflows", "default", json!({"workflow_id":"mixed-policy", + "workflow_type":"echo","task_queue":"mixed-policy","input":{"codec":"avro","external_payload":first}})).await; + assert_eq!(status, StatusCode::CREATED, "{started}"); + assert_eq!(policy(&app, "default", &replacement, true).await, StatusCode::OK); + assert_eq!(fetch(&app, "default", &first).await.0, StatusCode::OK); + let original_binding = binding(&database, &first).await; + let second = upload(&app, "default", "replacement result").await; + assert!(object(&original, &first).exists()); + assert!(object(&replacement, &second).exists()); + assert!(!object(&replacement, &first).exists()); + assert!(!object(&original, &second).exists()); + let second_binding = binding(&database, &second).await; + assert_eq!(binding(&database, &first).await, original_binding); + assert_eq!(original_binding["namespace"], "default"); + assert_eq!(second_binding["namespace"], "default"); + assert!(second_binding["generation"].as_i64().unwrap()>original_binding["generation"].as_i64().unwrap()); + assert_ne!(second_binding["root_uri"], original_binding["root_uri"]); + let (status, body) = json_request(&app, "POST", "/api/worker/register", "worker-token", + json!({"worker_id":"policy-worker","task_queue":"mixed-policy","runtime":"php", + "supported_workflow_types":["echo"],"supported_activity_types":[]})).await; + assert_eq!(status, StatusCode::CREATED, "{body}"); + let (status, polled) = json_request(&app, "POST", "/api/worker/workflow-tasks/poll", "worker-token", + json!({"worker_id":"policy-worker","task_queue":"mixed-policy","timeout_seconds":0})).await; + assert_eq!(status, StatusCode::OK, "{polled}"); + let task=&polled["task"]; + let (status, body) = json_request(&app, "POST", &format!("/api/worker/workflow-tasks/{}/complete",task["task_id"].as_str().unwrap()), + "worker-token",json!({"lease_owner":task["lease_owner"],"workflow_task_attempt":task["workflow_task_attempt"], + "commands":[{"type":"complete_workflow","result":{"codec":"avro","external_payload":second}}]})).await; assert_eq!(status, StatusCode::OK, "{body}"); - assert_eq!(body["results"][0]["outcome"], "pruned", "{body}"); - assert_eq!(policy(&router, "default", &next, true).await, StatusCode::OK); - let replacement = upload(&router, "default", "the next location").await; - assert!(object(&next, &replacement).exists()); - assert!(!object(&root, &replacement).exists()); + assert_eq!(policy(&app, "default", &replacement, false).await, StatusCode::OK); runtime.close().await; + let cold = database.open().await.unwrap().with_role_tokens(Some("worker-token".into()),Some("operator-token".into()),Some("admin-token".into())); + let cold_app=router(cold.clone()); + assert_eq!(fetch(&cold_app, "default", &first).await.0, StatusCode::OK); + assert_eq!(fetch(&cold_app, "default", &second).await.0, StatusCode::OK); + assert_eq!(prune(&cold_app,started["run_id"].as_str().unwrap()).await["external_payloads_deleted"],2); + assert!(!object(&original,&first).exists()); + assert!(!object(&replacement,&second).exists()); + assert_eq!(registered(&database,&first).await,0); + assert_eq!(registered(&database,&second).await,0); + cold.close().await; database.remove().await; } #[tokio::test] -async fn disabled_storage_still_allows_namespace_deletion() { - let temporary = tempfile::tempdir().unwrap(); - let root = temporary.path().join("objects"); - let (database, runtime, router) = setup(ExternalPayloadConfig::default(), &root).await; - assert_eq!(ns_request(&router, "POST", "/api/namespaces", "default", json!({"name":"disabled-delete"})).await.0, StatusCode::CREATED); - assert_eq!(policy(&router, "disabled-delete", &root, true).await, StatusCode::OK); - let reference = upload(&router, "disabled-delete", "delete while disabled").await; - closed_run(&router, "disabled-delete", "disabled-delete-run", &reference).await; - assert_eq!(policy(&router, "disabled-delete", &root, false).await, StatusCode::OK); - let (status, body) = ns_request(&router, "DELETE", "/api/namespaces/disabled-delete", "default", Value::Null).await; - assert_eq!(status, StatusCode::OK, "{body}"); - assert!(!object(&root, &reference).exists()); - assert_eq!(registered(&database, &reference).await, 0); +async fn mixed_generation_namespace_delete_keeps_the_other_namespace_owner_of_the_same_uri() { + let temporary=tempfile::tempdir().unwrap(); + let original=temporary.path().join("original"); + let replacement=temporary.path().join("replacement"); + let (database,runtime,app)=setup(ExternalPayloadConfig::default(),&original).await; + for name in ["mixed-delete","peer"] { + assert_eq!(ns_request(&app,"POST","/api/namespaces","default",json!({"name":name})).await.0,StatusCode::CREATED); + assert_eq!(policy(&app,name,&original,true).await,StatusCode::OK); + } + let first=upload(&app,"mixed-delete","shared original bytes").await; + closed_run(&app,"mixed-delete","mixed-delete-a",&first).await; + let peer=upload(&app,"peer","shared original bytes").await; + assert_eq!(policy(&app,"mixed-delete",&replacement,true).await,StatusCode::OK); + let second=upload(&app,"mixed-delete","replacement unclaimed bytes").await; + assert_eq!(policy(&app,"mixed-delete",&replacement,false).await,StatusCode::OK); + let (status,body)=ns_request(&app,"DELETE","/api/namespaces/mixed-delete","default",Value::Null).await; + assert_eq!(status,StatusCode::OK,"{body}"); + assert!(object(&original,&peer).exists()); + assert!(!object(&replacement,&second).exists()); + assert_eq!(registered(&database,&first).await,0); + assert_eq!(registered(&database,&second).await,0); + assert_eq!(registered(&database,&peer).await,1); + assert_eq!(fetch(&app,"peer",&peer).await.0,StatusCode::OK); + assert_eq!(ns_request(&app,"DELETE","/api/namespaces/peer","default",Value::Null).await.0,StatusCode::OK); + assert!(!object(&original,&peer).exists()); + runtime.close().await; + database.remove().await; +} + +#[tokio::test] +async fn a_binding_from_another_namespace_is_refused_even_for_the_same_physical_uri() { + let temporary=tempfile::tempdir().unwrap(); + let root=temporary.path().join("shared"); + let (database,runtime,app)=setup(ExternalPayloadConfig::default(),&root).await; + assert_eq!(ns_request(&app,"POST","/api/namespaces","default",json!({"name":"peer"})).await.0,StatusCode::CREATED); + assert_eq!(policy(&app,"peer",&root,true).await,StatusCode::OK); + let mine=upload(&app,"default","same physical bytes").await; + let theirs=upload(&app,"peer","same physical bytes").await; + assert_eq!(fetch(&app,"peer",&mine).await.0,StatusCode::NOT_FOUND); + assert_eq!(fetch(&app,"default",&theirs).await.0,StatusCode::NOT_FOUND); + let mine_binding=binding(&database,&mine).await; + let foreign_binding=binding(&database,&theirs).await; + replace_binding(&database,&mine,&foreign_binding).await; + let (status,body)=fetch(&app,"default",&mine).await; + assert_eq!(status,StatusCode::CONFLICT,"{body}"); + assert_eq!(body["reason"],"external_payload_storage_binding_unavailable"); + assert_eq!(body["retryable"],false); + assert!(!body.to_string().contains(root.to_str().unwrap())); + assert_eq!(fetch(&app,"peer",&theirs).await.0,StatusCode::OK); + replace_binding(&database,&mine,&mine_binding).await; + assert_eq!(fetch(&app,"default",&mine).await.0,StatusCode::OK); runtime.close().await; database.remove().await; } From 40f77b2da1adb538079ac6eed3acc6abfbdf564f Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sun, 15 Nov 2026 03:41:53 +0000 Subject: [PATCH 3/9] Add storage-binding primitives for retained payload repair --- rust/src/external_payload.rs | 2 + rust/src/external_payload/local.rs | 58 +++++- rust/src/external_payload/storage_binding.rs | 204 +++++++++++++++++++ 3 files changed, 259 insertions(+), 5 deletions(-) create mode 100644 rust/src/external_payload/storage_binding.rs diff --git a/rust/src/external_payload.rs b/rust/src/external_payload.rs index c8a13a285..fc900aa67 100644 --- a/rust/src/external_payload.rs +++ b/rust/src/external_payload.rs @@ -4,8 +4,10 @@ use serde::Serialize; use serde_json::Value; mod local; +mod storage_binding; mod snapshot; pub use local::LocalStorage; +pub(crate) use storage_binding::StorageBinding; pub use snapshot::{AsyncSnapshot, Snapshot, SnapshotError, capture}; pub const REFERENCE_SCHEMA: &str = "durable-workflow.v2.runtime-external-payload-reference.v1"; diff --git a/rust/src/external_payload/local.rs b/rust/src/external_payload/local.rs index ff08dcc9a..1c9a68926 100644 --- a/rust/src/external_payload/local.rs +++ b/rust/src/external_payload/local.rs @@ -28,6 +28,41 @@ fn checked(reference: &Reference) -> Result<(), SnapshotError> { } impl LocalStorage { + /// Resolve retained storage without creating a replacement for a missing + /// original root. A later symlink must not redirect the recorded owner. + pub(crate) async fn open_existing(root: PathBuf) -> Result { + let root = tokio::task::spawn_blocking(move || { + let canonical = root.canonicalize().map_err(unavailable)?; + if canonical.as_os_str() != root.as_os_str() + || !canonical.is_dir() + || canonical.to_str().is_none() + { + return Err(SnapshotError::Unavailable); + } + Ok(canonical) + }) + .await + .map_err(unavailable)??; + Ok(Self { + root: Arc::new(root), + }) + } + + pub(crate) fn canonical_root(&self) -> &std::path::Path { + self.root.as_path() + } + + /// Pure addressing used to validate a stored binding before filesystem I/O. + pub(crate) fn address_at( + root: PathBuf, + reference: &Reference, + ) -> Result { + Self { + root: Arc::new(root), + } + .uri_for(reference) + } + pub async fn open(root: PathBuf) -> Result { let root = tokio::task::spawn_blocking(move || { fs::create_dir_all(&root).map_err(unavailable)?; @@ -178,13 +213,18 @@ impl LocalStorage { /// The content address a `uri_for` URI names under this root. fn path_for_uri(&self, uri: &str) -> Result { - let encoded = uri.strip_prefix("file://").ok_or(SnapshotError::Unavailable)?.as_bytes(); + let encoded = uri + .strip_prefix("file://") + .ok_or(SnapshotError::Unavailable)? + .as_bytes(); let mut bytes = Vec::with_capacity(encoded.len()); let mut index = 0; while index < encoded.len() { let byte = encoded[index]; if byte == b'%' { - let hex = encoded.get(index + 1..index + 3).ok_or(SnapshotError::Unavailable)?; + let hex = encoded + .get(index + 1..index + 3) + .ok_or(SnapshotError::Unavailable)?; let hex = std::str::from_utf8(hex).map_err(unavailable)?; bytes.push(u8::from_str_radix(hex, 16).map_err(unavailable)?); index += 3; @@ -197,11 +237,17 @@ impl LocalStorage { } let path = PathBuf::from(String::from_utf8(bytes).map_err(unavailable)?); let relative = path.strip_prefix(&*self.root).map_err(unavailable)?; - let parts: Vec<&str> = relative.iter().map(|part| part.to_str().unwrap_or("")).collect(); + let parts: Vec<&str> = relative + .iter() + .map(|part| part.to_str().unwrap_or("")) + .collect(); let [kind, prefix, sha256] = parts.as_slice() else { return Err(SnapshotError::Unavailable); }; - let content = sha256.len() == 64 && sha256.bytes().all(|byte| matches!(byte, b'0'..=b'9' | b'a'..=b'f')); + let content = sha256.len() == 64 + && sha256 + .bytes() + .all(|byte| matches!(byte, b'0'..=b'9' | b'a'..=b'f')); if *kind != "avro" || !content || !sha256.starts_with(prefix) || prefix.len() != 2 { return Err(SnapshotError::Unavailable); } @@ -318,7 +364,9 @@ mod tests { #[tokio::test] async fn delete_uri_accepts_only_this_roots_content_address_and_replays() { let temp = tempfile::tempdir().unwrap(); - let storage = LocalStorage::open(temp.path().join("space λ")).await.unwrap(); + let storage = LocalStorage::open(temp.path().join("space λ")) + .await + .unwrap(); let expected = upload(&storage, temp.path(), b"bytes to reclaim").await; let uri = storage.uri_for(&expected).unwrap(); let path = storage.path(&expected).unwrap(); diff --git a/rust/src/external_payload/storage_binding.rs b/rust/src/external_payload/storage_binding.rs new file mode 100644 index 000000000..6a561e0bf --- /dev/null +++ b/rust/src/external_payload/storage_binding.rs @@ -0,0 +1,204 @@ +//! Internal, immutable location of one namespace's registered object. The +//! public reference stays opaque and never carries these filesystem details. +use super::{LocalStorage, Reference, SnapshotError}; +use serde::{Deserialize, Serialize}; +use serde_json::{Value, json}; +use std::path::{Component, PathBuf}; + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] +pub(crate) struct StorageBinding { + version: u8, + namespace: String, + generation: i64, + driver: String, + root_uri: String, +} + +impl StorageBinding { + pub(crate) fn new(namespace: &str, generation: i64, storage: &LocalStorage) -> Option { + let binding = Self { + version: 1, + namespace: namespace.to_owned(), + generation, + driver: "local".into(), + root_uri: format!("file://{}", storage.canonical_root().to_str()?), + }; + binding.root(namespace)?; + Some(binding) + } + + fn root(&self, namespace: &str) -> Option { + if self.version != 1 + || self.namespace != namespace + || namespace.is_empty() + || namespace.chars().count() > 128 + || self.generation < 1 + || self.driver != "local" + || self.root_uri.chars().count() > 4096 + || self.root_uri.contains('\0') + { + return None; + } + let root = PathBuf::from(self.root_uri.strip_prefix("file://")?); + if !root.is_absolute() + || root + .components() + .any(|part| matches!(part, Component::CurDir | Component::ParentDir)) + || self + .root_uri + .strip_prefix("file://")? + .split('/') + .any(|part| part == "." || part == "..") + || format!("file://{}", root.to_str()?) != self.root_uri + { + return None; + } + Some(root) + } + + /// Closed shape, owner and exact object address precede all filesystem I/O. + pub(crate) fn decode( + value: Value, + namespace: &str, + reference: &Reference, + uri: &str, + ) -> Option { + let binding: Self = serde_json::from_value(value).ok()?; + let root = binding.root(namespace)?; + if LocalStorage::address_at(root, reference).ok()? != uri { + return None; + } + Some(binding) + } + + pub(crate) async fn storage(&self) -> Result { + let root = self + .root(&self.namespace) + .ok_or(SnapshotError::Unavailable)?; + LocalStorage::open_existing(root).await + } + + pub(crate) fn deletion_policy(&self) -> Value { + // Reads/reclamation are independent of the newest upload-enable flag. + json!({"driver":"local","enabled":true,"config":{"uri":self.root_uri}}) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn reference() -> Reference { + Reference::validate(&json!({"schema":super::super::REFERENCE_SCHEMA, + "reference_id":"ep_01ARZ3NDEKTSV4RRFFQ69G5FAV","codec":"avro","size_bytes":0, + "sha256":"0".repeat(64)})) + .unwrap() + } + + #[tokio::test] + async fn bindings_keep_original_generation_location_and_namespace_without_public_reference_changes() + { + let temporary = tempfile::tempdir().unwrap(); + let first = LocalStorage::open(temporary.path().join("first")) + .await + .unwrap(); + let second = LocalStorage::open(temporary.path().join("second")) + .await + .unwrap(); + let reference = reference(); + let original = StorageBinding::new("default", 1, &first).unwrap(); + let moved = StorageBinding::new("default", 2, &second).unwrap(); + let original_value = serde_json::to_value(&original).unwrap(); + assert_ne!( + original_value["root_uri"], + serde_json::to_value(&moved).unwrap()["root_uri"] + ); + assert_eq!( + StorageBinding::decode( + original_value, + "default", + &reference, + &first.uri_for(&reference).unwrap() + ), + Some(original.clone()) + ); + assert_eq!( + original + .storage() + .await + .unwrap() + .uri_for(&reference) + .unwrap(), + first.uri_for(&reference).unwrap() + ); + assert_eq!( + serde_json::to_value(&reference) + .unwrap() + .as_object() + .unwrap() + .len(), + 5 + ); + assert_eq!(original.deletion_policy()["enabled"], true); + } + + #[tokio::test] + async fn foreign_unknown_malformed_and_substituted_bindings_refuse_before_storage_access() { + let temporary = tempfile::tempdir().unwrap(); + let storage = LocalStorage::open(temporary.path().join("original")) + .await + .unwrap(); + let reference = reference(); + let uri = storage.uri_for(&reference).unwrap(); + let original = + serde_json::to_value(StorageBinding::new("default", 1, &storage).unwrap()).unwrap(); + for (key, value) in [ + ("namespace", json!("peer")), + ("generation", json!(0)), + ("generation", json!(1.5)), + ("version", json!(2)), + ("driver", json!("unknown")), + ("extra", json!(true)), + ("root_uri", json!("file:///not/the/original/root")), + ("root_uri", json!("file:///a/../b")), + ] { + let mut altered = original.clone(); + altered[key] = value; + assert!( + StorageBinding::decode(altered, "default", &reference, &uri).is_none(), + "{key}" + ); + } + assert!( + StorageBinding::decode(original, "default", &reference, "file:///foreign/object") + .is_none() + ); + } + + #[tokio::test] + async fn a_missing_retained_root_is_not_recreated() { + let temporary = tempfile::tempdir().unwrap(); + let root = temporary.path().join("original"); + let storage = LocalStorage::open(root.clone()).await.unwrap(); + let binding = StorageBinding::new("default", 1, &storage).unwrap(); + std::fs::remove_dir(&root).unwrap(); + assert!(binding.storage().await.is_err()); + assert!(!root.exists()); + } + + #[cfg(unix)] + #[tokio::test] + async fn a_replaced_root_cannot_redirect_the_recorded_object() { + let temporary = tempfile::tempdir().unwrap(); + let root = temporary.path().join("original"); + let storage = LocalStorage::open(root.clone()).await.unwrap(); + let binding = StorageBinding::new("default", 1, &storage).unwrap(); + std::fs::rename(&root, temporary.path().join("retained")).unwrap(); + let foreign = temporary.path().join("foreign"); + std::fs::create_dir(&foreign).unwrap(); + std::os::unix::fs::symlink(&foreign, &root).unwrap(); + assert!(binding.storage().await.is_err()); + assert!(std::fs::read_dir(foreign).unwrap().next().is_none()); + } +} From 381f96952a16ae9b964c743d5498e767b32065f9 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sun, 15 Nov 2026 05:05:57 +0000 Subject: [PATCH 4/9] Preserve original native payload storage across policy changes --- docs/contracts/external-payload-storage.md | 28 + rust/README.md | 3 + rust/migrations/mariadb/0015_checksum.txt | 1 + rust/migrations/mariadb/0016_catalog.json | 254 + .../0016_external_storage_bindings.sql | 3 + rust/migrations/mysql/0016_checksum.txt | 1 + rust/migrations/mysql/0017_catalog.json | 254 + .../mysql/0017_external_storage_bindings.sql | 3 + rust/migrations/postgres/0015_checksum.txt | 1 + rust/migrations/postgres/0016_catalog.json | 19436 ++++++++++++++++ .../0016_external_storage_bindings.sql | 4 + rust/migrations/sqlite/0014_checksum.txt | 1 + .../sqlite/0015_external_storage_bindings.sql | 4 + rust/src/external_payload/local.rs | 9 + rust/src/external_payload/storage_binding.rs | 79 +- rust/src/runtime/execution.rs | 16 +- rust/src/runtime/external_registry.rs | 135 +- rust/src/runtime/external_resolution.rs | 2 +- rust/src/runtime/external_storage_binding.rs | 162 + rust/src/runtime/external_transport.rs | 13 +- rust/src/runtime/mod.rs | 1 + rust/src/runtime/mysql.rs | 203 +- rust/src/runtime/namespace_cleanup.rs | 129 +- rust/src/runtime/namespaces.rs | 20 +- rust/src/runtime/payload_cleanup.rs | 25 +- rust/src/runtime/payload_deletions.rs | 11 +- rust/src/runtime/postgres-catalog.sql | 4 +- rust/src/runtime/postgres.rs | 84 +- rust/src/runtime/retention_payloads.rs | 77 +- rust/src/runtime/schema.rs | 72 +- rust/src/runtime/signal_payloads.rs | 2 +- .../runtime/upgrade/takeover/mysql_journal.rs | 1 + .../execution/external_payloads/cleanup.rs | 12 +- .../external_payloads/namespace_delete.rs | 38 +- .../external_payloads/policy_changes.rs | 59 +- .../execution/external_payloads/retention.rs | 25 +- 36 files changed, 20930 insertions(+), 242 deletions(-) create mode 100644 rust/migrations/mariadb/0015_checksum.txt create mode 100644 rust/migrations/mariadb/0016_catalog.json create mode 100644 rust/migrations/mariadb/0016_external_storage_bindings.sql create mode 100644 rust/migrations/mysql/0016_checksum.txt create mode 100644 rust/migrations/mysql/0017_catalog.json create mode 100644 rust/migrations/mysql/0017_external_storage_bindings.sql create mode 100644 rust/migrations/postgres/0015_checksum.txt create mode 100644 rust/migrations/postgres/0016_catalog.json create mode 100644 rust/migrations/postgres/0016_external_storage_bindings.sql create mode 100644 rust/migrations/sqlite/0014_checksum.txt create mode 100644 rust/migrations/sqlite/0015_external_storage_bindings.sql create mode 100644 rust/src/runtime/external_storage_binding.rs diff --git a/docs/contracts/external-payload-storage.md b/docs/contracts/external-payload-storage.md index f1071be7e..44705f353 100644 --- a/docs/contracts/external-payload-storage.md +++ b/docs/contracts/external-payload-storage.md @@ -134,6 +134,34 @@ credentials, endpoints, bucket names, or object references. Production operators remain responsible for object-store durability, access policy, backup, retention, and recovery validation. +### Native local-storage policy changes + +The native local driver records the original namespace, storage generation and +canonical root with each admitted object. Disabling new uploads keeps existing +references readable and reclaimable. Moving the namespace write policy sends +new objects to the new root; existing objects keep their original bindings. +Keep every retained root mounted and accessible to the runtime and maintenance +processes until its objects and committed deletion records have been reclaimed. +Changing the policy does not copy objects between roots. + +A disable request that omits the location preserves the configured location. +An upload admitted before a policy change can finish at its original root; +requests admitted afterward use the current enabled policy. The public reference +and authenticated namespace boundary remain unchanged. + +Schema upgrade leaves older registrations unbound until their recorded URI can +be matched to an admitted local policy. Reads bind them on first use, and a +policy change pins them before replacing the policy. An unavailable or mismatched +original root returns the nonretryable +`external_payload_storage_binding_unavailable` outcome. Restore the original +mount or explicitly configure its matching location before retrying the failed +operation. The runtime does not recreate an empty retained root or infer storage +authority from an arbitrary URI. + +Backups must preserve the registry and deletion journals together with bytes +from all retained roots, including roots no longer selected for new uploads. +Prove restored reads before releasing the backup hold. + ## State, expiry, and retention An upload starts as unclaimed and expires after the advertised abandoned-upload diff --git a/rust/README.md b/rust/README.md index 9ce01be56..eef3b49b0 100644 --- a/rust/README.md +++ b/rust/README.md @@ -539,6 +539,9 @@ restart, all database families and S3 qualification. The actual byte probe is an isolated runtime configured with its disposable fixture token, a default namespace, four MiB payload ceiling and one-object namespace quota. See the [port log](../docs/rust-server-port.md) for its precise acceptance scope. +Registered local objects retain their original storage bindings across disabled +or moved write policies. Preserve all retained roots through backup and recovery; +see [local policy changes](../docs/contracts/external-payload-storage.md#native-local-storage-policy-changes). Workflow start, activity arguments, terminal workflow completion and activity completion accept verified opaque external payloads. Retention commits with the admitted input or fenced result; cold delivery, history and descriptions keep references for normal SDK hydration. diff --git a/rust/migrations/mariadb/0015_checksum.txt b/rust/migrations/mariadb/0015_checksum.txt new file mode 100644 index 000000000..e59885fc4 --- /dev/null +++ b/rust/migrations/mariadb/0015_checksum.txt @@ -0,0 +1 @@ +b35a67f3f950226a48d2ebf64e668d4dbe84aac2990e47c31bb758ff5817dce0872294e1fbf7994ea868a4d0f8d7d1c5 diff --git a/rust/migrations/mariadb/0016_catalog.json b/rust/migrations/mariadb/0016_catalog.json new file mode 100644 index 000000000..d8f00490e --- /dev/null +++ b/rust/migrations/mariadb/0016_catalog.json @@ -0,0 +1,254 @@ +[ + [ + "activity_attempts", + "CREATE TABLE `activity_attempts` (\n `id` varchar(26) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `activity_execution_id` varchar(26) NOT NULL,\n `workflow_task_id` varchar(26) DEFAULT NULL,\n `worker_attempt_id` varchar(255) DEFAULT NULL,\n `attempt_number` int(10) unsigned NOT NULL,\n `status` varchar(255) NOT NULL,\n `lease_owner` varchar(255) DEFAULT NULL,\n `started_at` timestamp(6) NOT NULL,\n `last_heartbeat_at` timestamp(6) NULL DEFAULT NULL,\n `lease_expires_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `activity_attempts_activity_execution_id_attempt_number_unique` (`activity_execution_id`,`attempt_number`),\n KEY `activity_attempts_workflow_run_id_index` (`workflow_run_id`),\n KEY `activity_attempts_activity_execution_id_index` (`activity_execution_id`),\n KEY `activity_attempts_workflow_task_id_index` (`workflow_task_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "activity_executions", + "CREATE TABLE `activity_executions` (\n `id` varchar(26) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `sequence` int(10) unsigned NOT NULL,\n `activity_class` varchar(255) NOT NULL,\n `activity_type` varchar(255) NOT NULL,\n `status` varchar(255) NOT NULL,\n `payload_codec` varchar(255) DEFAULT NULL,\n `arguments` longtext DEFAULT NULL,\n `result` longtext DEFAULT NULL,\n `exception` longtext DEFAULT NULL,\n `connection` varchar(255) DEFAULT NULL,\n `queue` varchar(255) DEFAULT NULL,\n `attempt_count` int(10) unsigned NOT NULL DEFAULT 1,\n `current_attempt_id` varchar(26) DEFAULT NULL,\n `retry_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`retry_policy`)),\n `parallel_group_path` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`parallel_group_path`)),\n `activity_options` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`activity_options`)),\n `schedule_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `close_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `schedule_to_close_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `heartbeat_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `last_heartbeat_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `activity_executions_workflow_run_id_sequence_unique` (`workflow_run_id`,`sequence`),\n KEY `activity_executions_workflow_run_id_index` (`workflow_run_id`),\n KEY `activity_exec_prom_metrics_series_idx` (`workflow_run_id`,`queue`,`activity_type`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_command_intents", + "CREATE TABLE `dw_command_intents` (\n `command_id` varchar(26) NOT NULL,\n `namespace` varchar(191) NOT NULL,\n `intent_digest` varchar(71) NOT NULL,\n PRIMARY KEY (`command_id`),\n KEY `dw_command_intents_namespace` (`namespace`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_external_payload_deletions", + "CREATE TABLE `dw_external_payload_deletions` (\n `id` varchar(26) NOT NULL,\n `namespace` varchar(191) NOT NULL,\n `storage_uri` text NOT NULL,\n `storage_uri_sha256` varchar(64) NOT NULL,\n `storage_policy` longtext NOT NULL,\n `attempts` bigint(20) NOT NULL DEFAULT 0,\n `failure_code` varchar(64) DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `dw_external_payload_deletions_uri` (`namespace`,`storage_uri_sha256`),\n KEY `dw_external_payload_deletions_due` (`namespace`,`updated_at`,`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_poll_receipts", + "CREATE TABLE `dw_poll_receipts` (\n `namespace` varchar(255) NOT NULL,\n `worker_id` varchar(255) NOT NULL,\n `kind` varchar(8) COLLATE ascii_bin NOT NULL,\n `request_id` varchar(255) NOT NULL,\n `task_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `attempt` bigint(20) NOT NULL,\n `response` longtext COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`response`)),\n `expires_at` timestamp(6) NOT NULL,\n PRIMARY KEY (`namespace`,`worker_id`,`kind`,`request_id`),\n KEY `dw_poll_receipts_task` (`task_id`),\n KEY `dw_poll_receipts_expiration` (`expires_at`),\n CONSTRAINT `dw_poll_receipts_task` FOREIGN KEY (`task_id`) REFERENCES `workflow_tasks` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_nopad_bin" + ], + [ + "dw_query_cache", + "CREATE TABLE `dw_query_cache` (\n `key` varchar(64) NOT NULL,\n `value` longtext NOT NULL,\n `expiration` bigint(20) NOT NULL,\n PRIMARY KEY (`key`),\n KEY `dw_query_cache_expiration` (`expiration`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" + ], + [ + "dw_run_command_contracts", + "CREATE TABLE `dw_run_command_contracts` (\n `workflow_run_id` varchar(191) NOT NULL,\n `namespace` varchar(191) NOT NULL,\n `workflow_type` varchar(255) NOT NULL,\n `contract` longtext NOT NULL,\n `worker_id` varchar(255) DEFAULT NULL,\n `workflow_task_id` varchar(191) NOT NULL,\n `bound_at` datetime(6) NOT NULL,\n PRIMARY KEY (`workflow_run_id`),\n KEY `dw_run_command_contracts_namespace` (`namespace`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_server_schema", + "CREATE TABLE `dw_server_schema` (\n `engine` varchar(64) NOT NULL,\n `version` bigint(20) NOT NULL,\n `bootstrap_checksum` varbinary(48) NOT NULL,\n PRIMARY KEY (`engine`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" + ], + [ + "dw_service_admission_counters", + "CREATE TABLE `dw_service_admission_counters` (\n `cache_key` varchar(191) NOT NULL,\n `amount` bigint(20) NOT NULL,\n `expires_at` datetime(6) NOT NULL,\n PRIMARY KEY (`cache_key`),\n KEY `dw_service_admission_counters_expiry` (`expires_at`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_service_call_deadlines", + "CREATE TABLE `dw_service_call_deadlines` (\n `service_call_id` varchar(26) NOT NULL,\n `namespace` varchar(128) NOT NULL,\n `call_deadline_at` datetime(6) NOT NULL,\n PRIMARY KEY (`service_call_id`),\n KEY `dw_service_call_deadlines_due` (`call_deadline_at`,`service_call_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_stream_reclaims", + "CREATE TABLE `dw_stream_reclaims` (\n `stream_id` bigint(20) unsigned NOT NULL,\n `namespace` varchar(128) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `reclaim_at` datetime(6) NOT NULL,\n PRIMARY KEY (`stream_id`),\n KEY `dw_stream_reclaims_due` (`namespace`,`reclaim_at`,`stream_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_task_completions", + "CREATE TABLE `dw_task_completions` (\n `task_id` varchar(26) NOT NULL,\n `receipt` longtext COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`receipt`)),\n PRIMARY KEY (`task_id`),\n CONSTRAINT `dw_task_completions_task` FOREIGN KEY (`task_id`) REFERENCES `workflow_tasks` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_task_queue_pauses", + "CREATE TABLE `dw_task_queue_pauses` (\n `namespace` varchar(191) COLLATE utf8mb4_bin NOT NULL,\n `task_queue` varchar(255) COLLATE utf8mb4_bin NOT NULL,\n `reason` text DEFAULT NULL,\n `paused_by` text DEFAULT NULL,\n `paused_at` datetime(6) NOT NULL,\n `resumed_by` text DEFAULT NULL,\n `resumed_at` datetime(6) DEFAULT NULL,\n PRIMARY KEY (`namespace`,`task_queue`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_worker_registration_incarnations", + "CREATE TABLE `dw_worker_registration_incarnations` (\n `token` char(32) COLLATE ascii_bin NOT NULL,\n `namespace` varchar(255) NOT NULL,\n `worker_id` varchar(255) NOT NULL,\n `status` varchar(32) NOT NULL,\n `recovered_workflow_task_count` bigint(20) DEFAULT NULL,\n `finished_at` datetime(6) DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`token`),\n KEY `dw_worker_incarnation_authority` (`namespace`,`worker_id`,`status`),\n KEY `dw_worker_incarnation_retention` (`status`,`finished_at`),\n CONSTRAINT `dw_worker_incarnation_state` CHECK (`status` = 'active' and `finished_at` is null and `recovered_workflow_task_count` is null or `status` = 'superseded' and `finished_at` is not null and `recovered_workflow_task_count` is null or `status` = 'deregistered' and `finished_at` is not null and `recovered_workflow_task_count` is not null and `recovered_workflow_task_count` >= 0)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_worker_session_holders", + "CREATE TABLE `dw_worker_session_holders` (\n `namespace` varchar(128) NOT NULL,\n `session_id` varchar(255) NOT NULL,\n `incarnation` char(64) COLLATE ascii_bin NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`namespace`,`session_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "failed_jobs", + "CREATE TABLE `failed_jobs` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `uuid` varchar(255) NOT NULL,\n `connection` text NOT NULL,\n `queue` text NOT NULL,\n `payload` longtext NOT NULL,\n `exception` longtext NOT NULL,\n `failed_at` timestamp NOT NULL DEFAULT current_timestamp(),\n PRIMARY KEY (`id`),\n UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "jobs", + "CREATE TABLE `jobs` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `queue` varchar(255) NOT NULL,\n `payload` longtext NOT NULL,\n `attempts` tinyint(3) unsigned NOT NULL,\n `reserved_at` int(10) unsigned DEFAULT NULL,\n `available_at` int(10) unsigned NOT NULL,\n `created_at` int(10) unsigned NOT NULL,\n PRIMARY KEY (`id`),\n KEY `jobs_queue_index` (`queue`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "migrations", + "CREATE TABLE `migrations` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `migration` varchar(255) NOT NULL,\n `batch` int(11) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_credentials", + "CREATE TABLE `runtime_credentials` (\n `id` varchar(64) NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `subject` varchar(255) NOT NULL,\n `roles` longtext COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`roles`)),\n `tenant` varchar(128) NOT NULL,\n `claims` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`claims`)),\n `token_prefix` varchar(16) NOT NULL,\n `token_hash` char(64) NOT NULL,\n `expires_at` timestamp NULL DEFAULT NULL,\n `revoked_at` timestamp NULL DEFAULT NULL,\n `rotated_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `runtime_credentials_token_hash_unique` (`token_hash`),\n KEY `runtime_credentials_tenant_index` (`tenant`),\n KEY `runtime_credentials_expires_at_index` (`expires_at`),\n KEY `runtime_credentials_revoked_at_index` (`revoked_at`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_external_payloads", + "CREATE TABLE `runtime_external_payloads` (\n `id` varchar(64) NOT NULL,\n `namespace` varchar(128) NOT NULL,\n `storage_uri` text NOT NULL,\n `storage_uri_sha256` char(64) NOT NULL,\n `codec` varchar(64) NOT NULL,\n `sha256` char(64) NOT NULL,\n `size_bytes` bigint(20) unsigned NOT NULL,\n `upload_status` varchar(16) NOT NULL DEFAULT 'ready',\n `retained_at` timestamp NULL DEFAULT NULL,\n `expires_at` timestamp NULL DEFAULT NULL,\n `last_fetched_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `storage_binding` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `runtime_external_payloads_namespace_uri_unique` (`namespace`,`storage_uri_sha256`),\n KEY `runtime_external_payloads_namespace_index` (`namespace`),\n KEY `runtime_external_payloads_expires_at_index` (`expires_at`),\n KEY `runtime_external_payloads_reclamation_idx` (`retained_at`,`expires_at`,`upload_status`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_external_payload_backup_hold", + "CREATE TABLE `runtime_external_payload_backup_hold` (\n `id` tinyint(3) unsigned NOT NULL,\n `owner` char(36) DEFAULT NULL,\n `acquired_at` timestamp NULL DEFAULT NULL,\n `expires_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_external_payload_cleanup_stats", + "CREATE TABLE `runtime_external_payload_cleanup_stats` (\n `namespace` varchar(128) NOT NULL,\n `passes_total` bigint(20) unsigned NOT NULL DEFAULT 0,\n `deleted_references_total` bigint(20) unsigned NOT NULL DEFAULT 0,\n `deleted_backing_objects_total` bigint(20) unsigned NOT NULL DEFAULT 0,\n `shared_objects_preserved_total` bigint(20) unsigned NOT NULL DEFAULT 0,\n `blocked_outcomes_total` bigint(20) unsigned NOT NULL DEFAULT 0,\n `storage_driver_failures_total` bigint(20) unsigned NOT NULL DEFAULT 0,\n `last_processed` int(10) unsigned NOT NULL DEFAULT 0,\n `last_deleted_references` int(10) unsigned NOT NULL DEFAULT 0,\n `last_deleted_backing_objects` int(10) unsigned NOT NULL DEFAULT 0,\n `last_shared_objects_preserved` int(10) unsigned NOT NULL DEFAULT 0,\n `last_blocked_outcomes` int(10) unsigned NOT NULL DEFAULT 0,\n `last_storage_driver_failures` int(10) unsigned NOT NULL DEFAULT 0,\n `last_pass_status` varchar(16) DEFAULT NULL,\n `last_completed_at` timestamp NULL DEFAULT NULL,\n `last_storage_failure_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`namespace`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_external_payload_object_locks", + "CREATE TABLE `runtime_external_payload_object_locks` (\n `bucket` smallint(5) unsigned NOT NULL,\n PRIMARY KEY (`bucket`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_payload_completion_budgets", + "CREATE TABLE `runtime_payload_completion_budgets` (\n `id` char(64) NOT NULL,\n `namespace` varchar(128) NOT NULL,\n `context` longtext COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`context`)),\n `slots` longtext COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`slots`)),\n `objects` longtext COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`objects`)),\n `expires_at` timestamp NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `runtime_payload_completion_budgets_namespace_index` (`namespace`),\n KEY `runtime_payload_completion_budgets_expires_at_index` (`expires_at`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "search_attribute_definitions", + "CREATE TABLE `search_attribute_definitions` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `namespace` varchar(128) NOT NULL,\n `name` varchar(128) NOT NULL,\n `type` varchar(32) NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `search_attribute_definitions_namespace_name_unique` (`namespace`,`name`),\n KEY `search_attribute_definitions_namespace_index` (`namespace`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_child_calls", + "CREATE TABLE `workflow_child_calls` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `parent_workflow_run_id` varchar(26) NOT NULL,\n `parent_workflow_instance_id` varchar(191) NOT NULL,\n `sequence` int(10) unsigned NOT NULL,\n `child_workflow_type` varchar(191) NOT NULL,\n `child_workflow_class` varchar(255) NOT NULL,\n `requested_child_id` varchar(191) DEFAULT NULL,\n `resolved_child_instance_id` varchar(191) DEFAULT NULL,\n `resolved_child_run_id` varchar(26) DEFAULT NULL,\n `parent_close_policy` varchar(32) NOT NULL DEFAULT 'abandon',\n `connection` varchar(191) DEFAULT NULL,\n `queue` varchar(191) DEFAULT NULL,\n `compatibility` varchar(191) DEFAULT NULL,\n `retry_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`retry_policy`)),\n `timeout_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`timeout_policy`)),\n `cancellation_propagation` tinyint(1) NOT NULL DEFAULT 0,\n `status` varchar(32) NOT NULL DEFAULT 'scheduled',\n `result_payload_reference` varchar(191) DEFAULT NULL,\n `failure_reference` varchar(191) DEFAULT NULL,\n `closed_reason` varchar(64) DEFAULT NULL,\n `scheduled_at` timestamp(6) NOT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `arguments` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`arguments`)),\n `metadata` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `child_calls_parent_seq` (`parent_workflow_run_id`,`sequence`),\n KEY `child_calls_parent_status` (`parent_workflow_run_id`,`status`),\n KEY `child_calls_child_parent` (`resolved_child_instance_id`,`parent_workflow_run_id`),\n KEY `workflow_child_calls_parent_workflow_run_id_index` (`parent_workflow_run_id`),\n KEY `workflow_child_calls_parent_workflow_instance_id_index` (`parent_workflow_instance_id`),\n KEY `workflow_child_calls_sequence_index` (`sequence`),\n KEY `workflow_child_calls_resolved_child_instance_id_index` (`resolved_child_instance_id`),\n KEY `workflow_child_calls_resolved_child_run_id_index` (`resolved_child_run_id`),\n KEY `workflow_child_calls_status_index` (`status`),\n CONSTRAINT `workflow_child_calls_parent_workflow_run_id_foreign` FOREIGN KEY (`parent_workflow_run_id`) REFERENCES `workflow_runs` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_child_projection_repairs", + "CREATE TABLE `workflow_child_projection_repairs` (\n `workflow_history_event_id` varchar(26) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `workflow_task_id` varchar(26) NOT NULL,\n `history_sequence` int(10) unsigned NOT NULL,\n `failure_id` varchar(26) DEFAULT NULL,\n `failed_child_counted_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`workflow_history_event_id`),\n KEY `workflow_child_projection_repairs_drain_idx` (`workflow_run_id`,`workflow_task_id`,`history_sequence`),\n KEY `workflow_child_projection_repairs_failure_idx` (`workflow_run_id`,`failure_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_commands", + "CREATE TABLE `workflow_commands` (\n `id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) DEFAULT NULL,\n `workflow_run_id` varchar(26) DEFAULT NULL,\n `requested_workflow_run_id` varchar(26) DEFAULT NULL,\n `resolved_workflow_run_id` varchar(26) DEFAULT NULL,\n `command_type` varchar(255) NOT NULL,\n `target_scope` varchar(255) NOT NULL DEFAULT 'instance',\n `source` varchar(255) NOT NULL DEFAULT 'php',\n `context` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`context`)),\n `request_id` varchar(191) DEFAULT NULL,\n `status` varchar(255) NOT NULL,\n `outcome` varchar(255) DEFAULT NULL,\n `workflow_class` varchar(255) DEFAULT NULL,\n `workflow_type` varchar(255) DEFAULT NULL,\n `payload_codec` varchar(255) DEFAULT NULL,\n `payload` longtext DEFAULT NULL,\n `rejection_reason` varchar(255) DEFAULT NULL,\n `command_sequence` int(10) unsigned DEFAULT NULL,\n `message_sequence` int(10) unsigned DEFAULT NULL,\n `accepted_at` timestamp(6) NULL DEFAULT NULL,\n `applied_at` timestamp(6) NULL DEFAULT NULL,\n `rejected_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_commands_request_lookup` (`workflow_instance_id`,`command_type`,`request_id`),\n KEY `workflow_commands_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_commands_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_commands_requested_workflow_run_id_index` (`requested_workflow_run_id`),\n KEY `workflow_commands_resolved_workflow_run_id_index` (`resolved_workflow_run_id`),\n KEY `workflow_commands_command_type_index` (`command_type`),\n KEY `workflow_commands_source_index` (`source`),\n KEY `workflow_commands_status_index` (`status`),\n KEY `workflow_commands_command_sequence_index` (`command_sequence`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_durable_streams", + "CREATE TABLE `workflow_durable_streams` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `namespace` varchar(128) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `stream_name` varchar(191) NOT NULL,\n `status` varchar(16) NOT NULL DEFAULT 'open',\n `last_offset` bigint(20) NOT NULL DEFAULT -1,\n `total_items` bigint(20) unsigned NOT NULL DEFAULT 0,\n `retention_seconds` int(10) unsigned DEFAULT NULL,\n `opened_at` timestamp(6) NULL DEFAULT NULL,\n `last_appended_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `error_reason` varchar(191) DEFAULT NULL,\n `pending_items` bigint(20) unsigned NOT NULL DEFAULT 0,\n `metadata` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_durable_streams_run_name_unique` (`workflow_run_id`,`stream_name`),\n KEY `wf_durable_streams_ns_instance_name_idx` (`namespace`,`workflow_instance_id`,`stream_name`),\n KEY `wf_durable_streams_ns_status_idx` (`namespace`,`status`),\n KEY `workflow_durable_streams_namespace_index` (`namespace`),\n KEY `workflow_durable_streams_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_durable_streams_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_durable_streams_status_index` (`status`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_durable_stream_items", + "CREATE TABLE `workflow_durable_stream_items` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `stream_id` bigint(20) unsigned NOT NULL,\n `namespace` varchar(128) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `stream_name` varchar(191) NOT NULL,\n `offset` bigint(20) NOT NULL,\n `idempotency_key` varchar(191) DEFAULT NULL,\n `origin` varchar(64) NOT NULL DEFAULT 'workflow_command',\n `origin_reference` varchar(191) DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),\n `payload_reference` varchar(191) DEFAULT NULL,\n `payload_codec` varchar(64) DEFAULT NULL,\n `item_type` varchar(64) DEFAULT NULL,\n `content_type` varchar(191) DEFAULT NULL,\n `emitted_at` timestamp(6) NOT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_durable_stream_items_stream_offset_unique` (`stream_id`,`offset`),\n UNIQUE KEY `wf_durable_stream_items_idempotency_unique` (`stream_id`,`idempotency_key`),\n KEY `wf_durable_stream_items_run_name_offset_idx` (`workflow_run_id`,`stream_name`,`offset`),\n KEY `workflow_durable_stream_items_namespace_index` (`namespace`),\n KEY `workflow_durable_stream_items_workflow_run_id_index` (`workflow_run_id`),\n CONSTRAINT `workflow_durable_stream_items_stream_id_foreign` FOREIGN KEY (`stream_id`) REFERENCES `workflow_durable_streams` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_failures", + "CREATE TABLE `workflow_failures` (\n `id` varchar(26) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `source_kind` varchar(255) NOT NULL,\n `source_id` varchar(255) NOT NULL,\n `propagation_kind` varchar(255) NOT NULL,\n `failure_category` varchar(255) DEFAULT NULL,\n `non_retryable` tinyint(1) NOT NULL DEFAULT 0,\n `handled` tinyint(1) NOT NULL DEFAULT 0,\n `exception_class` varchar(255) NOT NULL,\n `message` text NOT NULL,\n `file` text NOT NULL,\n `line` int(10) unsigned DEFAULT NULL,\n `trace_preview` longtext DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `workflow_failures_source_kind_source_id_index` (`source_kind`,`source_id`),\n KEY `workflow_failures_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_failures_failure_category_index` (`failure_category`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_history_events", + "CREATE TABLE `workflow_history_events` (\n `id` varchar(26) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `sequence` int(10) unsigned NOT NULL,\n `event_type` varchar(255) NOT NULL,\n `payload` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),\n `workflow_task_id` varchar(26) DEFAULT NULL,\n `workflow_command_id` varchar(26) DEFAULT NULL,\n `recorded_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `recorded_at_utc` datetime(6) DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_history_events_workflow_run_id_sequence_unique` (`workflow_run_id`,`sequence`),\n KEY `workflow_history_events_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_history_events_workflow_task_id_index` (`workflow_task_id`),\n KEY `workflow_history_events_workflow_command_id_index` (`workflow_command_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_inbound_streams", + "CREATE TABLE `workflow_inbound_streams` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `namespace` varchar(128) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `stream_name` varchar(128) NOT NULL,\n `last_position` bigint(20) unsigned NOT NULL DEFAULT 0,\n `cursor_position` bigint(20) unsigned NOT NULL DEFAULT 0,\n `cursor_checkpoint_run_id` varchar(26) DEFAULT NULL,\n `waiting_run_id` varchar(26) DEFAULT NULL,\n `waiting_after_position` bigint(20) unsigned DEFAULT NULL,\n `waiting_since` timestamp(6) NULL DEFAULT NULL,\n `duplicate_count` bigint(20) unsigned NOT NULL DEFAULT 0,\n `malformed_count` bigint(20) unsigned NOT NULL DEFAULT 0,\n `last_input_outcome` varchar(64) DEFAULT NULL,\n `last_input_message_id` varchar(191) DEFAULT NULL,\n `last_input_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `cleanup_blocked_at` timestamp(6) NULL DEFAULT NULL,\n `cleanup_blocked_reason` varchar(64) DEFAULT NULL,\n `cleanup_blocked_run_id` varchar(26) DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_inbound_streams_ns_instance_name_unique` (`namespace`,`workflow_instance_id`,`stream_name`),\n KEY `workflow_inbound_streams_namespace_index` (`namespace`),\n KEY `workflow_inbound_streams_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_inbound_streams_cursor_checkpoint_run_id_index` (`cursor_checkpoint_run_id`),\n KEY `workflow_inbound_streams_waiting_run_id_index` (`waiting_run_id`),\n KEY `workflow_inbound_streams_cleanup_blocked_run_id_index` (`cleanup_blocked_run_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_inbound_stream_items", + "CREATE TABLE `workflow_inbound_stream_items` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `stream_id` bigint(20) unsigned NOT NULL,\n `namespace` varchar(128) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `stream_name` varchar(128) NOT NULL,\n `message_id` varchar(191) NOT NULL,\n `position` bigint(20) unsigned NOT NULL,\n `payload_codec` varchar(32) NOT NULL,\n `payload_blob` longtext NOT NULL,\n `payload_hash` varchar(64) NOT NULL,\n `delivered_run_id` varchar(26) DEFAULT NULL,\n `workflow_command_id` varchar(26) DEFAULT NULL,\n `delivered_at` timestamp(6) NULL DEFAULT NULL,\n `consumed_run_id` varchar(26) DEFAULT NULL,\n `consumed_task_id` varchar(26) DEFAULT NULL,\n `consumed_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `payload_released_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_inbound_items_stream_message_unique` (`stream_id`,`message_id`),\n UNIQUE KEY `wf_inbound_items_stream_position_unique` (`stream_id`,`position`),\n KEY `wf_inbound_items_ns_instance_name_position_idx` (`namespace`,`workflow_instance_id`,`stream_name`,`position`),\n KEY `workflow_inbound_stream_items_namespace_index` (`namespace`),\n KEY `workflow_inbound_stream_items_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_inbound_stream_items_delivered_run_id_index` (`delivered_run_id`),\n KEY `workflow_inbound_stream_items_workflow_command_id_index` (`workflow_command_id`),\n KEY `workflow_inbound_stream_items_consumed_run_id_index` (`consumed_run_id`),\n KEY `workflow_inbound_stream_items_consumed_task_id_index` (`consumed_task_id`),\n KEY `workflow_inbound_stream_items_payload_released_at_index` (`payload_released_at`),\n CONSTRAINT `workflow_inbound_stream_items_stream_id_foreign` FOREIGN KEY (`stream_id`) REFERENCES `workflow_inbound_streams` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_instances", + "CREATE TABLE `workflow_instances` (\n `id` varchar(191) NOT NULL,\n `workflow_class` varchar(255) NOT NULL,\n `workflow_type` varchar(255) NOT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `business_key` varchar(191) DEFAULT NULL,\n `visibility_labels` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`visibility_labels`)),\n `memo` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`memo`)),\n `execution_timeout_seconds` int(10) unsigned DEFAULT NULL,\n `current_run_id` varchar(26) DEFAULT NULL,\n `run_count` int(10) unsigned NOT NULL DEFAULT 0,\n `last_message_sequence` int(10) unsigned NOT NULL DEFAULT 0,\n `reserved_at` timestamp(6) NULL DEFAULT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `workflow_instances_namespace_index` (`namespace`),\n KEY `workflow_instances_business_key_index` (`business_key`),\n KEY `workflow_instances_current_run_id_index` (`current_run_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_links", + "CREATE TABLE `workflow_links` (\n `id` varchar(26) NOT NULL,\n `link_type` varchar(255) NOT NULL,\n `sequence` int(10) unsigned DEFAULT NULL,\n `parallel_group_path` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`parallel_group_path`)),\n `parent_workflow_instance_id` varchar(191) NOT NULL,\n `parent_workflow_run_id` varchar(26) NOT NULL,\n `child_workflow_instance_id` varchar(191) NOT NULL,\n `child_workflow_run_id` varchar(26) NOT NULL,\n `is_primary_parent` tinyint(1) NOT NULL DEFAULT 0,\n `parent_close_policy` varchar(255) NOT NULL DEFAULT 'abandon',\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_links_parent_child_type_unique` (`parent_workflow_run_id`,`child_workflow_run_id`,`link_type`),\n KEY `workflow_links_parent_sequence_type_index` (`parent_workflow_run_id`,`sequence`,`link_type`),\n KEY `workflow_links_parent_workflow_instance_id_index` (`parent_workflow_instance_id`),\n KEY `workflow_links_parent_workflow_run_id_index` (`parent_workflow_run_id`),\n KEY `workflow_links_child_workflow_instance_id_index` (`child_workflow_instance_id`),\n KEY `workflow_links_child_workflow_run_id_index` (`child_workflow_run_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_memos", + "CREATE TABLE `workflow_memos` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `workflow_run_id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `key` varchar(191) NOT NULL,\n `value` longtext COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`value`)),\n `upserted_at_sequence` int(10) unsigned NOT NULL,\n `inherited_from_parent` tinyint(1) NOT NULL DEFAULT 0,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `portable_value` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`portable_value`)),\n `portable_value_sequence` int(10) unsigned DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_memos_run_key_unique` (`workflow_run_id`,`key`),\n KEY `workflow_memos_instance_key` (`workflow_instance_id`,`key`),\n CONSTRAINT `workflow_memos_workflow_run_id_foreign` FOREIGN KEY (`workflow_run_id`) REFERENCES `workflow_runs` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_messages", + "CREATE TABLE `workflow_messages` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `workflow_instance_id` varchar(191) NOT NULL,\n `workflow_run_id` varchar(26) DEFAULT NULL,\n `direction` varchar(16) NOT NULL,\n `channel` varchar(64) NOT NULL,\n `stream_key` varchar(191) NOT NULL,\n `sequence` bigint(20) unsigned NOT NULL,\n `source_workflow_instance_id` varchar(191) DEFAULT NULL,\n `source_workflow_run_id` varchar(26) DEFAULT NULL,\n `target_workflow_instance_id` varchar(191) DEFAULT NULL,\n `target_workflow_run_id` varchar(26) DEFAULT NULL,\n `correlation_id` varchar(191) DEFAULT NULL,\n `idempotency_key` varchar(191) DEFAULT NULL,\n `payload_reference` varchar(191) DEFAULT NULL,\n `consume_state` varchar(16) NOT NULL DEFAULT 'pending',\n `consumed_at` timestamp(6) NULL DEFAULT NULL,\n `consumed_by_sequence` int(10) unsigned DEFAULT NULL,\n `expires_at` timestamp(6) NULL DEFAULT NULL,\n `delivery_attempt_count` int(10) unsigned NOT NULL DEFAULT 0,\n `last_delivery_attempt_at` timestamp(6) NULL DEFAULT NULL,\n `last_delivery_error` text DEFAULT NULL,\n `metadata` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_msgs_stream_seq_unique` (`workflow_instance_id`,`stream_key`,`sequence`),\n KEY `wf_msgs_instance_stream_seq` (`workflow_instance_id`,`stream_key`,`sequence`),\n KEY `wf_msgs_run_dir_state` (`workflow_run_id`,`direction`,`consume_state`),\n KEY `wf_msgs_stream_seq_state` (`stream_key`,`sequence`,`consume_state`),\n KEY `wf_msgs_target_state` (`target_workflow_instance_id`,`consume_state`),\n KEY `workflow_messages_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_messages_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_messages_direction_index` (`direction`),\n KEY `workflow_messages_channel_index` (`channel`),\n KEY `workflow_messages_stream_key_index` (`stream_key`),\n KEY `workflow_messages_sequence_index` (`sequence`),\n KEY `workflow_messages_source_workflow_instance_id_index` (`source_workflow_instance_id`),\n KEY `workflow_messages_target_workflow_instance_id_index` (`target_workflow_instance_id`),\n KEY `workflow_messages_correlation_id_index` (`correlation_id`),\n KEY `workflow_messages_idempotency_key_index` (`idempotency_key`),\n KEY `workflow_messages_consume_state_index` (`consume_state`),\n CONSTRAINT `workflow_messages_workflow_run_id_foreign` FOREIGN KEY (`workflow_run_id`) REFERENCES `workflow_runs` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_namespaces", + "CREATE TABLE `workflow_namespaces` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(128) NOT NULL,\n `description` varchar(1000) DEFAULT NULL,\n `retention_mode` varchar(32) NOT NULL DEFAULT 'bounded',\n `retention_days` int(10) unsigned DEFAULT 30,\n `status` varchar(32) NOT NULL DEFAULT 'active',\n `external_payload_storage` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`external_payload_storage`)),\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `external_payload_storage_generation` bigint(20) NOT NULL DEFAULT 0,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_namespaces_name_unique` (`name`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_runs", + "CREATE TABLE `workflow_runs` (\n `id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `run_number` int(10) unsigned NOT NULL,\n `workflow_class` varchar(255) NOT NULL,\n `workflow_type` varchar(255) NOT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `business_key` varchar(191) DEFAULT NULL,\n `visibility_labels` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`visibility_labels`)),\n `status` varchar(255) NOT NULL,\n `closed_reason` varchar(255) DEFAULT NULL,\n `compatibility` varchar(255) DEFAULT NULL,\n `payload_codec` varchar(255) DEFAULT NULL,\n `arguments` longtext DEFAULT NULL,\n `output` longtext DEFAULT NULL,\n `output_payload_codec` varchar(255) DEFAULT NULL,\n `connection` varchar(255) DEFAULT NULL,\n `queue` varchar(255) DEFAULT NULL,\n `priority` tinyint(3) unsigned NOT NULL DEFAULT 5,\n `fairness_key` varchar(64) DEFAULT NULL,\n `fairness_weight` smallint(5) unsigned NOT NULL DEFAULT 1,\n `sticky_worker_id` varchar(255) DEFAULT NULL,\n `sticky_until` timestamp(6) NULL DEFAULT NULL,\n `last_history_sequence` int(10) unsigned NOT NULL DEFAULT 0,\n `last_command_sequence` int(10) unsigned NOT NULL DEFAULT 0,\n `message_cursor_position` int(10) unsigned NOT NULL DEFAULT 0,\n `run_timeout_seconds` int(10) unsigned DEFAULT NULL,\n `execution_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `run_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `archived_at` timestamp(6) NULL DEFAULT NULL,\n `archive_command_id` varchar(26) DEFAULT NULL,\n `archive_reason` varchar(255) DEFAULT NULL,\n `last_progress_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `import_source` varchar(64) DEFAULT NULL,\n `import_id` varchar(64) DEFAULT NULL,\n `import_dedupe_key` varchar(191) DEFAULT NULL,\n `import_contract_version` smallint(5) unsigned DEFAULT NULL,\n `imported_at` timestamp(6) NULL DEFAULT NULL,\n `cancellation_request_command_id` varchar(26) DEFAULT NULL,\n `cancellation_requested_at` timestamp(6) NULL DEFAULT NULL,\n `cancellation_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `cancellation_delivery_sequence` int(10) unsigned DEFAULT NULL,\n `cancellation_delivered_at` timestamp(6) NULL DEFAULT NULL,\n `details_pruned_at` timestamp(6) NULL DEFAULT NULL,\n `cancellation_scope_recovery_until` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_runs_workflow_instance_id_run_number_unique` (`workflow_instance_id`,`run_number`),\n KEY `workflow_runs_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_runs_namespace_index` (`namespace`),\n KEY `workflow_runs_business_key_index` (`business_key`),\n KEY `workflow_runs_sticky_worker_id_index` (`sticky_worker_id`),\n KEY `workflow_runs_sticky_until_index` (`sticky_until`),\n KEY `workflow_runs_archived_at_index` (`archived_at`),\n KEY `workflow_runs_archive_command_id_index` (`archive_command_id`),\n KEY `workflow_runs_import_source_index` (`import_source`),\n KEY `workflow_runs_import_id_index` (`import_id`),\n KEY `workflow_runs_import_dedupe_key_index` (`import_dedupe_key`),\n KEY `workflow_runs_imported_at_index` (`imported_at`),\n KEY `workflow_runs_prom_metrics_queue_idx` (`namespace`,`queue`),\n KEY `workflow_runs_namespace_status_quota_idx` (`namespace`,`status`),\n KEY `workflow_runs_cancellation_request_command_id_index` (`cancellation_request_command_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_lineage_entries", + "CREATE TABLE `workflow_run_lineage_entries` (\n `id` varchar(64) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `direction` varchar(255) NOT NULL,\n `lineage_id` varchar(191) NOT NULL,\n `position` int(10) unsigned NOT NULL,\n `link_type` varchar(255) NOT NULL,\n `child_call_id` varchar(26) DEFAULT NULL,\n `sequence` int(10) unsigned DEFAULT NULL,\n `is_primary_parent` tinyint(1) NOT NULL DEFAULT 0,\n `related_workflow_instance_id` varchar(191) DEFAULT NULL,\n `related_workflow_run_id` varchar(26) DEFAULT NULL,\n `related_run_number` int(10) unsigned DEFAULT NULL,\n `related_workflow_type` varchar(191) DEFAULT NULL,\n `related_workflow_class` varchar(255) DEFAULT NULL,\n `status` varchar(255) DEFAULT NULL,\n `status_bucket` varchar(255) DEFAULT NULL,\n `closed_reason` varchar(255) DEFAULT NULL,\n `linked_at` timestamp(6) NULL DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_run_lineage_run_direction_lineage_unique` (`workflow_run_id`,`direction`,`lineage_id`),\n KEY `workflow_run_lineage_run_direction_position_index` (`workflow_run_id`,`direction`,`position`),\n KEY `workflow_run_lineage_instance_direction_type_index` (`workflow_instance_id`,`direction`,`link_type`),\n KEY `workflow_run_lineage_entries_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_run_lineage_entries_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_run_lineage_entries_direction_index` (`direction`),\n KEY `workflow_run_lineage_entries_link_type_index` (`link_type`),\n KEY `workflow_run_lineage_entries_child_call_id_index` (`child_call_id`),\n KEY `workflow_run_lineage_entries_sequence_index` (`sequence`),\n KEY `workflow_run_lineage_entries_is_primary_parent_index` (`is_primary_parent`),\n KEY `workflow_run_lineage_entries_related_workflow_instance_id_index` (`related_workflow_instance_id`),\n KEY `workflow_run_lineage_entries_related_workflow_run_id_index` (`related_workflow_run_id`),\n KEY `workflow_run_lineage_entries_related_workflow_type_index` (`related_workflow_type`),\n KEY `workflow_run_lineage_entries_status_index` (`status`),\n KEY `workflow_run_lineage_entries_status_bucket_index` (`status_bucket`),\n KEY `workflow_run_lineage_entries_closed_reason_index` (`closed_reason`),\n KEY `workflow_run_lineage_entries_linked_at_index` (`linked_at`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_summaries", + "CREATE TABLE `workflow_run_summaries` (\n `id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `run_number` int(10) unsigned NOT NULL,\n `is_current_run` tinyint(1) NOT NULL DEFAULT 0,\n `engine_source` varchar(255) NOT NULL DEFAULT 'v2',\n `projection_schema_version` smallint(5) unsigned DEFAULT NULL,\n `class` varchar(255) NOT NULL,\n `workflow_type` varchar(255) NOT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `compatibility` varchar(255) DEFAULT NULL,\n `declared_entry_mode` varchar(255) DEFAULT NULL,\n `declared_contract_source` varchar(255) DEFAULT NULL,\n `business_key` varchar(191) DEFAULT NULL,\n `visibility_labels` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`visibility_labels`)),\n `status` varchar(255) NOT NULL,\n `status_bucket` varchar(255) NOT NULL,\n `closed_reason` varchar(255) DEFAULT NULL,\n `connection` varchar(255) DEFAULT NULL,\n `queue` varchar(255) DEFAULT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `sort_timestamp` timestamp(6) NULL DEFAULT NULL,\n `sort_key` varchar(64) DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `archived_at` timestamp(6) NULL DEFAULT NULL,\n `archive_command_id` varchar(26) DEFAULT NULL,\n `archive_reason` varchar(255) DEFAULT NULL,\n `duration_ms` bigint(20) DEFAULT NULL,\n `wait_kind` varchar(255) DEFAULT NULL,\n `wait_reason` text DEFAULT NULL,\n `wait_started_at` timestamp(6) NULL DEFAULT NULL,\n `wait_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `open_wait_id` varchar(191) DEFAULT NULL,\n `resume_source_kind` varchar(255) DEFAULT NULL,\n `resume_source_id` varchar(191) DEFAULT NULL,\n `next_task_at` timestamp(6) NULL DEFAULT NULL,\n `liveness_state` varchar(255) DEFAULT NULL,\n `liveness_reason` text DEFAULT NULL,\n `repair_blocked_reason` varchar(255) DEFAULT NULL,\n `repair_attention` tinyint(1) NOT NULL DEFAULT 0,\n `task_problem` tinyint(1) NOT NULL DEFAULT 0,\n `next_task_id` varchar(26) DEFAULT NULL,\n `next_task_type` varchar(255) DEFAULT NULL,\n `next_task_status` varchar(255) DEFAULT NULL,\n `next_task_lease_expires_at` timestamp(6) NULL DEFAULT NULL,\n `exception_count` int(10) unsigned NOT NULL DEFAULT 0,\n `history_event_count` int(10) unsigned NOT NULL DEFAULT 0,\n `history_size_bytes` bigint(20) unsigned NOT NULL DEFAULT 0,\n `history_fan_out` int(10) unsigned NOT NULL DEFAULT 0,\n `continue_as_new_recommended` tinyint(1) NOT NULL DEFAULT 0,\n `history_budget_pressure` varchar(32) NOT NULL DEFAULT 'ok',\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `workflow_run_summaries_status_bucket_started_at_index` (`status_bucket`,`started_at`),\n KEY `workflow_run_summaries_sort_order_index` (`sort_timestamp`,`id`),\n KEY `wfrs_namespace_sort_idx` (`namespace`,`sort_timestamp`,`id`),\n KEY `wfrs_namespace_type_sort_idx` (`namespace`,`workflow_type`,`sort_timestamp`,`id`),\n KEY `wfrs_namespace_status_sort_idx` (`namespace`,`status_bucket`,`sort_timestamp`,`id`),\n KEY `workflow_run_summaries_sort_key_index` (`sort_key`),\n KEY `workflow_run_summaries_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_run_summaries_is_current_run_index` (`is_current_run`),\n KEY `workflow_run_summaries_projection_schema_version_index` (`projection_schema_version`),\n KEY `workflow_run_summaries_namespace_index` (`namespace`),\n KEY `wfrs_decl_entry_mode_idx` (`declared_entry_mode`),\n KEY `wfrs_decl_contract_source_idx` (`declared_contract_source`),\n KEY `workflow_run_summaries_business_key_index` (`business_key`),\n KEY `workflow_run_summaries_status_index` (`status`),\n KEY `workflow_run_summaries_status_bucket_index` (`status_bucket`),\n KEY `workflow_run_summaries_archived_at_index` (`archived_at`),\n KEY `workflow_run_summaries_archive_command_id_index` (`archive_command_id`),\n KEY `workflow_run_summaries_repair_blocked_reason_index` (`repair_blocked_reason`),\n KEY `workflow_run_summaries_repair_attention_index` (`repair_attention`),\n KEY `workflow_run_summaries_continue_as_new_recommended_index` (`continue_as_new_recommended`),\n KEY `workflow_run_summaries_history_budget_pressure_index` (`history_budget_pressure`),\n KEY `wfrs_prom_metrics_series_idx` (`namespace`,`queue`,`workflow_type`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_timeline_entries", + "CREATE TABLE `workflow_run_timeline_entries` (\n `id` varchar(64) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `history_event_id` varchar(26) NOT NULL,\n `sequence` int(10) unsigned NOT NULL,\n `type` varchar(255) NOT NULL,\n `kind` varchar(255) NOT NULL,\n `entry_kind` varchar(255) NOT NULL DEFAULT 'point',\n `source_kind` varchar(255) DEFAULT NULL,\n `source_id` varchar(191) DEFAULT NULL,\n `summary` text DEFAULT NULL,\n `recorded_at` timestamp(6) NULL DEFAULT NULL,\n `command_id` varchar(26) DEFAULT NULL,\n `command_sequence` int(10) unsigned DEFAULT NULL,\n `task_id` varchar(26) DEFAULT NULL,\n `activity_execution_id` varchar(26) DEFAULT NULL,\n `timer_id` varchar(191) DEFAULT NULL,\n `failure_id` varchar(26) DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_run_timeline_run_event_unique` (`workflow_run_id`,`history_event_id`),\n KEY `workflow_run_timeline_run_sequence_index` (`workflow_run_id`,`sequence`),\n KEY `workflow_run_timeline_instance_kind_recorded_index` (`workflow_instance_id`,`kind`,`recorded_at`),\n KEY `workflow_run_timeline_entries_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_run_timeline_entries_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_run_timeline_entries_history_event_id_index` (`history_event_id`),\n KEY `workflow_run_timeline_entries_sequence_index` (`sequence`),\n KEY `workflow_run_timeline_entries_type_index` (`type`),\n KEY `workflow_run_timeline_entries_kind_index` (`kind`),\n KEY `workflow_run_timeline_entries_source_kind_index` (`source_kind`),\n KEY `workflow_run_timeline_entries_source_id_index` (`source_id`),\n KEY `workflow_run_timeline_entries_recorded_at_index` (`recorded_at`),\n KEY `workflow_run_timeline_entries_command_id_index` (`command_id`),\n KEY `workflow_run_timeline_entries_command_sequence_index` (`command_sequence`),\n KEY `workflow_run_timeline_entries_task_id_index` (`task_id`),\n KEY `workflow_run_timeline_entries_activity_execution_id_index` (`activity_execution_id`),\n KEY `workflow_run_timeline_entries_timer_id_index` (`timer_id`),\n KEY `workflow_run_timeline_entries_failure_id_index` (`failure_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_timers", + "CREATE TABLE `workflow_run_timers` (\n `id` varchar(26) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `sequence` int(10) unsigned NOT NULL,\n `status` varchar(255) NOT NULL,\n `delay_seconds` bigint(20) unsigned NOT NULL,\n `fire_at` timestamp(6) NOT NULL,\n `fired_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_run_timers_workflow_run_id_sequence_unique` (`workflow_run_id`,`sequence`),\n KEY `workflow_run_timers_status_fire_at_index` (`status`,`fire_at`),\n KEY `workflow_run_timers_workflow_run_id_index` (`workflow_run_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_timer_entries", + "CREATE TABLE `workflow_run_timer_entries` (\n `id` varchar(64) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `timer_id` varchar(191) NOT NULL,\n `schema_version` smallint(5) unsigned NOT NULL DEFAULT 1,\n `position` int(10) unsigned NOT NULL,\n `sequence` int(10) unsigned DEFAULT NULL,\n `status` varchar(255) NOT NULL,\n `source_status` varchar(255) DEFAULT NULL,\n `delay_seconds` int(11) DEFAULT NULL,\n `fire_at` timestamp(6) NULL DEFAULT NULL,\n `fired_at` timestamp(6) NULL DEFAULT NULL,\n `cancelled_at` timestamp(6) NULL DEFAULT NULL,\n `timer_kind` varchar(191) DEFAULT NULL,\n `condition_wait_id` varchar(191) DEFAULT NULL,\n `condition_key` varchar(191) DEFAULT NULL,\n `condition_definition_fingerprint` varchar(191) DEFAULT NULL,\n `history_authority` varchar(255) DEFAULT NULL,\n `history_unsupported_reason` varchar(255) DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_run_timer_entries_run_timer_unique` (`workflow_run_id`,`timer_id`),\n KEY `workflow_run_timer_entries_run_status_position_index` (`workflow_run_id`,`status`,`position`),\n KEY `workflow_run_timer_entries_instance_kind_status_index` (`workflow_instance_id`,`timer_kind`,`status`),\n KEY `workflow_run_timer_entries_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_run_timer_entries_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_run_timer_entries_sequence_index` (`sequence`),\n KEY `workflow_run_timer_entries_status_index` (`status`),\n KEY `workflow_run_timer_entries_source_status_index` (`source_status`),\n KEY `workflow_run_timer_entries_timer_kind_index` (`timer_kind`),\n KEY `workflow_run_timer_entries_condition_wait_id_index` (`condition_wait_id`),\n KEY `workflow_run_timer_entries_condition_key_index` (`condition_key`),\n KEY `workflow_run_timer_entries_history_authority_index` (`history_authority`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_waits", + "CREATE TABLE `workflow_run_waits` (\n `id` varchar(64) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `wait_id` varchar(191) NOT NULL,\n `position` int(10) unsigned NOT NULL,\n `kind` varchar(255) NOT NULL,\n `sequence` int(10) unsigned DEFAULT NULL,\n `status` varchar(255) NOT NULL,\n `source_status` varchar(255) DEFAULT NULL,\n `summary` text DEFAULT NULL,\n `opened_at` timestamp(6) NULL DEFAULT NULL,\n `deadline_at` timestamp(6) NULL DEFAULT NULL,\n `resolved_at` timestamp(6) NULL DEFAULT NULL,\n `target_name` varchar(191) DEFAULT NULL,\n `target_type` varchar(191) DEFAULT NULL,\n `task_backed` tinyint(1) NOT NULL DEFAULT 0,\n `external_only` tinyint(1) NOT NULL DEFAULT 0,\n `resume_source_kind` varchar(191) DEFAULT NULL,\n `resume_source_id` varchar(191) DEFAULT NULL,\n `task_id` varchar(26) DEFAULT NULL,\n `task_type` varchar(255) DEFAULT NULL,\n `task_status` varchar(255) DEFAULT NULL,\n `command_id` varchar(26) DEFAULT NULL,\n `command_sequence` int(10) unsigned DEFAULT NULL,\n `command_status` varchar(255) DEFAULT NULL,\n `command_outcome` varchar(255) DEFAULT NULL,\n `history_authority` varchar(255) DEFAULT NULL,\n `history_unsupported_reason` varchar(255) DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_run_waits_run_wait_unique` (`workflow_run_id`,`wait_id`),\n KEY `workflow_run_waits_run_status_position_index` (`workflow_run_id`,`status`,`position`),\n KEY `workflow_run_waits_instance_kind_status_index` (`workflow_instance_id`,`kind`,`status`),\n KEY `workflow_run_waits_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_run_waits_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_run_waits_kind_index` (`kind`),\n KEY `workflow_run_waits_sequence_index` (`sequence`),\n KEY `workflow_run_waits_status_index` (`status`),\n KEY `workflow_run_waits_source_status_index` (`source_status`),\n KEY `workflow_run_waits_target_name_index` (`target_name`),\n KEY `workflow_run_waits_task_backed_index` (`task_backed`),\n KEY `workflow_run_waits_resume_source_kind_index` (`resume_source_kind`),\n KEY `workflow_run_waits_resume_source_id_index` (`resume_source_id`),\n KEY `workflow_run_waits_task_id_index` (`task_id`),\n KEY `workflow_run_waits_command_id_index` (`command_id`),\n KEY `workflow_run_waits_history_authority_index` (`history_authority`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_schedules", + "CREATE TABLE `workflow_schedules` (\n `id` varchar(26) NOT NULL,\n `schedule_id` varchar(255) NOT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `spec` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`spec`)),\n `action` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`action`)),\n `status` varchar(16) NOT NULL DEFAULT 'active',\n `overlap_policy` varchar(32) NOT NULL DEFAULT 'skip',\n `note` text DEFAULT NULL,\n `memo` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`memo`)),\n `search_attributes` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`search_attributes`)),\n `visibility_labels` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`visibility_labels`)),\n `jitter_seconds` int(10) unsigned NOT NULL DEFAULT 0,\n `max_runs` bigint(20) unsigned DEFAULT NULL,\n `remaining_actions` bigint(20) unsigned DEFAULT NULL,\n `fires_count` bigint(20) unsigned NOT NULL DEFAULT 0,\n `failures_count` bigint(20) unsigned NOT NULL DEFAULT 0,\n `recent_actions` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`recent_actions`)),\n `buffered_actions` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`buffered_actions`)),\n `last_fired_at` timestamp(6) NULL DEFAULT NULL,\n `next_fire_at` timestamp(6) NULL DEFAULT NULL,\n `latest_workflow_instance_id` varchar(191) DEFAULT NULL,\n `connection` varchar(255) DEFAULT NULL,\n `queue` varchar(255) DEFAULT NULL,\n `paused_at` timestamp(6) NULL DEFAULT NULL,\n `deleted_at` timestamp(6) NULL DEFAULT NULL,\n `last_skip_reason` varchar(64) DEFAULT NULL,\n `last_skipped_at` timestamp(6) NULL DEFAULT NULL,\n `skipped_trigger_count` bigint(20) unsigned NOT NULL DEFAULT 0,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `dispatch_summary` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_schedules_namespace_schedule_id_unique` (`namespace`,`schedule_id`),\n KEY `workflow_schedules_status_next_fire_at_index` (`status`,`next_fire_at`),\n KEY `workflow_schedules_namespace_index` (`namespace`),\n KEY `workflow_schedules_latest_workflow_instance_id_index` (`latest_workflow_instance_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_schedule_history_events", + "CREATE TABLE `workflow_schedule_history_events` (\n `id` varchar(26) NOT NULL,\n `workflow_schedule_id` varchar(26) NOT NULL,\n `schedule_id` varchar(255) NOT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `sequence` int(10) unsigned NOT NULL,\n `event_type` varchar(255) NOT NULL,\n `payload` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),\n `workflow_instance_id` varchar(191) DEFAULT NULL,\n `workflow_run_id` varchar(26) DEFAULT NULL,\n `recorded_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `occurrence_at_utc` varchar(26) DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_schedule_history_schedule_sequence_unique` (`workflow_schedule_id`,`sequence`),\n KEY `wf_schedule_history_namespace_schedule_idx` (`namespace`,`schedule_id`),\n KEY `wf_schedule_history_event_recorded_idx` (`event_type`,`recorded_at`),\n KEY `wf_schedule_history_workflow_schedule_idx` (`workflow_schedule_id`),\n KEY `wf_schedule_history_schedule_idx` (`schedule_id`),\n KEY `wf_schedule_history_namespace_idx` (`namespace`),\n KEY `wf_schedule_history_instance_idx` (`workflow_instance_id`),\n KEY `wf_schedule_history_run_idx` (`workflow_run_id`),\n KEY `wf_schedule_history_occurrence_idx` (`workflow_schedule_id`,`event_type`,`occurrence_at_utc`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_search_attributes", + "CREATE TABLE `workflow_search_attributes` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `workflow_run_id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `key` varchar(191) NOT NULL COMMENT 'Attribute name (e.g., \"customer_id\", \"priority\", \"region\")',\n `type` varchar(16) NOT NULL COMMENT 'Type: string, keyword, int, float, bool, datetime',\n `value_string` text DEFAULT NULL COMMENT 'For type=string (max 2048 chars enforced at app level)',\n `value_keyword` varchar(255) DEFAULT NULL COMMENT 'For type=keyword (exact match, indexed)',\n `value_keyword_list` longtext COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'For type=keyword_list (ordered exact-match values)' CHECK (json_valid(`value_keyword_list`)),\n `value_int` bigint(20) DEFAULT NULL COMMENT 'For type=int',\n `value_float` double DEFAULT NULL COMMENT 'For type=float',\n `value_bool` tinyint(1) DEFAULT NULL COMMENT 'For type=bool',\n `value_datetime` timestamp(6) NULL DEFAULT NULL COMMENT 'For type=datetime (microsecond precision)',\n `upserted_at_sequence` int(10) unsigned NOT NULL COMMENT 'History sequence when this attribute was last upserted',\n `inherited_from_parent` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'True if inherited via continue-as-new',\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_search_attrs_run_key_unique` (`workflow_run_id`,`key`),\n KEY `workflow_search_attrs_instance_key_type` (`workflow_instance_id`,`key`,`type`),\n KEY `workflow_search_attrs_key_keyword` (`key`,`value_keyword`),\n KEY `workflow_search_attrs_key_int` (`key`,`value_int`),\n KEY `workflow_search_attrs_key_float` (`key`,`value_float`),\n KEY `workflow_search_attrs_key_bool` (`key`,`value_bool`),\n KEY `workflow_search_attrs_key_datetime` (`key`,`value_datetime`),\n KEY `workflow_search_attributes_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_search_attributes_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_search_attributes_value_keyword_index` (`value_keyword`),\n KEY `workflow_search_attributes_value_int_index` (`value_int`),\n KEY `workflow_search_attributes_value_float_index` (`value_float`),\n KEY `workflow_search_attributes_value_bool_index` (`value_bool`),\n KEY `workflow_search_attributes_value_datetime_index` (`value_datetime`),\n CONSTRAINT `workflow_search_attributes_workflow_run_id_foreign` FOREIGN KEY (`workflow_run_id`) REFERENCES `workflow_runs` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_services", + "CREATE TABLE `workflow_services` (\n `id` varchar(26) NOT NULL,\n `workflow_service_endpoint_id` varchar(26) NOT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `service_name` varchar(191) NOT NULL,\n `description` text DEFAULT NULL,\n `boundary_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`boundary_policy`)),\n `metadata` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_services_namespace_endpoint_name_unique` (`namespace`,`workflow_service_endpoint_id`,`service_name`),\n KEY `wf_services_namespace_name_idx` (`namespace`,`service_name`),\n KEY `wf_services_endpoint_idx` (`workflow_service_endpoint_id`),\n KEY `wf_services_namespace_idx` (`namespace`),\n KEY `wf_services_name_idx` (`service_name`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_service_calls", + "CREATE TABLE `workflow_service_calls` (\n `id` varchar(26) NOT NULL,\n `workflow_service_endpoint_id` varchar(26) DEFAULT NULL,\n `workflow_service_id` varchar(26) DEFAULT NULL,\n `workflow_service_operation_id` varchar(26) DEFAULT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `endpoint_name` varchar(191) NOT NULL,\n `service_name` varchar(191) NOT NULL,\n `operation_name` varchar(191) NOT NULL,\n `caller_namespace` varchar(255) DEFAULT NULL,\n `caller_workflow_instance_id` varchar(191) DEFAULT NULL,\n `caller_workflow_run_id` varchar(26) DEFAULT NULL,\n `target_namespace` varchar(255) DEFAULT NULL,\n `linked_workflow_instance_id` varchar(191) DEFAULT NULL,\n `linked_workflow_run_id` varchar(26) DEFAULT NULL,\n `linked_workflow_update_id` varchar(26) DEFAULT NULL,\n `status` varchar(32) NOT NULL,\n `outcome` varchar(64) DEFAULT NULL,\n `operation_mode` varchar(32) NOT NULL,\n `resolved_binding_kind` varchar(64) DEFAULT NULL,\n `resolved_target_reference` varchar(191) DEFAULT NULL,\n `payload_codec` varchar(255) DEFAULT NULL,\n `input_payload_reference` varchar(191) DEFAULT NULL,\n `output_payload_reference` varchar(191) DEFAULT NULL,\n `failure_payload_reference` varchar(191) DEFAULT NULL,\n `failure_message` text DEFAULT NULL,\n `idempotency_key` varchar(191) DEFAULT NULL,\n `deadline_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`deadline_policy`)),\n `idempotency_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`idempotency_policy`)),\n `cancellation_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`cancellation_policy`)),\n `retry_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`retry_policy`)),\n `boundary_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`boundary_policy`)),\n `metadata` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),\n `outcome_category` varchar(32) DEFAULT NULL,\n `outcome_reason` varchar(191) DEFAULT NULL,\n `outcome_message` text DEFAULT NULL,\n `outcome_metadata` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`outcome_metadata`)),\n `policy_name` varchar(191) DEFAULT NULL,\n `retry_after_seconds` int(10) unsigned DEFAULT NULL,\n `caller_principal_subject` varchar(191) DEFAULT NULL,\n `caller_principal_method` varchar(64) DEFAULT NULL,\n `caller_principal_roles` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`caller_principal_roles`)),\n `caller_principal_tenant` varchar(191) DEFAULT NULL,\n `caller_principal_claims` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`caller_principal_claims`)),\n `accepted_at` timestamp(6) NULL DEFAULT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `completed_at` timestamp(6) NULL DEFAULT NULL,\n `failed_at` timestamp(6) NULL DEFAULT NULL,\n `cancelled_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `wf_service_calls_namespace_status_idx` (`namespace`,`status`),\n KEY `wf_service_calls_caller_status_idx` (`caller_namespace`,`status`),\n KEY `wf_service_calls_target_status_idx` (`target_namespace`,`status`),\n KEY `wf_service_calls_namespace_outcome_idx` (`namespace`,`outcome`),\n KEY `wf_service_calls_caller_outcome_idx` (`caller_namespace`,`outcome`),\n KEY `wf_service_calls_target_outcome_idx` (`target_namespace`,`outcome`),\n KEY `wf_service_calls_endpoint_idx` (`workflow_service_endpoint_id`),\n KEY `wf_service_calls_service_idx` (`workflow_service_id`),\n KEY `wf_service_calls_operation_idx` (`workflow_service_operation_id`),\n KEY `wf_service_calls_namespace_idx` (`namespace`),\n KEY `wf_service_calls_caller_namespace_idx` (`caller_namespace`),\n KEY `wf_service_calls_caller_instance_idx` (`caller_workflow_instance_id`),\n KEY `wf_service_calls_caller_run_idx` (`caller_workflow_run_id`),\n KEY `wf_service_calls_target_namespace_idx` (`target_namespace`),\n KEY `wf_service_calls_linked_instance_idx` (`linked_workflow_instance_id`),\n KEY `wf_service_calls_linked_run_idx` (`linked_workflow_run_id`),\n KEY `wf_service_calls_linked_update_idx` (`linked_workflow_update_id`),\n KEY `wf_service_calls_status_idx` (`status`),\n KEY `wf_service_calls_outcome_idx` (`outcome`),\n KEY `wf_service_calls_mode_idx` (`operation_mode`),\n KEY `wf_service_calls_binding_kind_idx` (`resolved_binding_kind`),\n KEY `wf_service_calls_idempotency_idx` (`idempotency_key`),\n KEY `wf_service_calls_outcome_category_idx` (`outcome_category`),\n KEY `wf_service_calls_policy_idx` (`policy_name`),\n KEY `wf_service_calls_principal_subject_idx` (`caller_principal_subject`),\n KEY `wf_service_calls_accepted_at_idx` (`accepted_at`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_service_endpoints", + "CREATE TABLE `workflow_service_endpoints` (\n `id` varchar(26) NOT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `endpoint_name` varchar(191) NOT NULL,\n `description` text DEFAULT NULL,\n `boundary_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`boundary_policy`)),\n `metadata` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_service_endpoints_namespace_name_unique` (`namespace`,`endpoint_name`),\n KEY `wf_service_endpoints_namespace_idx` (`namespace`),\n KEY `wf_service_endpoints_name_idx` (`endpoint_name`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_service_operations", + "CREATE TABLE `workflow_service_operations` (\n `id` varchar(26) NOT NULL,\n `workflow_service_endpoint_id` varchar(26) NOT NULL,\n `workflow_service_id` varchar(26) NOT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `operation_name` varchar(191) NOT NULL,\n `description` text DEFAULT NULL,\n `operation_mode` varchar(32) NOT NULL,\n `handler_binding_kind` varchar(64) NOT NULL,\n `handler_target_reference` varchar(191) DEFAULT NULL,\n `handler_binding` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`handler_binding`)),\n `deadline_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`deadline_policy`)),\n `idempotency_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`idempotency_policy`)),\n `cancellation_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`cancellation_policy`)),\n `retry_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`retry_policy`)),\n `boundary_policy` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`boundary_policy`)),\n `metadata` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_service_ops_namespace_service_name_unique` (`namespace`,`workflow_service_id`,`operation_name`),\n KEY `wf_service_ops_namespace_name_idx` (`namespace`,`operation_name`),\n KEY `wf_service_ops_endpoint_idx` (`workflow_service_endpoint_id`),\n KEY `wf_service_ops_service_idx` (`workflow_service_id`),\n KEY `wf_service_ops_namespace_idx` (`namespace`),\n KEY `wf_service_ops_name_idx` (`operation_name`),\n KEY `wf_service_ops_mode_idx` (`operation_mode`),\n KEY `wf_service_ops_binding_kind_idx` (`handler_binding_kind`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_signal_records", + "CREATE TABLE `workflow_signal_records` (\n `id` varchar(26) NOT NULL,\n `workflow_command_id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) DEFAULT NULL,\n `workflow_run_id` varchar(26) DEFAULT NULL,\n `target_scope` varchar(255) NOT NULL DEFAULT 'instance',\n `requested_workflow_run_id` varchar(26) DEFAULT NULL,\n `resolved_workflow_run_id` varchar(26) DEFAULT NULL,\n `signal_name` varchar(255) NOT NULL,\n `signal_wait_id` varchar(255) DEFAULT NULL,\n `status` varchar(255) NOT NULL,\n `outcome` varchar(255) DEFAULT NULL,\n `command_sequence` int(10) unsigned DEFAULT NULL,\n `workflow_sequence` int(10) unsigned DEFAULT NULL,\n `payload_codec` varchar(255) DEFAULT NULL,\n `arguments` longtext DEFAULT NULL,\n `validation_errors` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`validation_errors`)),\n `rejection_reason` varchar(255) DEFAULT NULL,\n `received_at` timestamp(6) NULL DEFAULT NULL,\n `applied_at` timestamp(6) NULL DEFAULT NULL,\n `rejected_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_signal_records_workflow_command_id_unique` (`workflow_command_id`),\n KEY `workflow_signal_records_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_signal_records_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_signal_records_requested_workflow_run_id_index` (`requested_workflow_run_id`),\n KEY `workflow_signal_records_resolved_workflow_run_id_index` (`resolved_workflow_run_id`),\n KEY `workflow_signal_records_signal_name_index` (`signal_name`),\n KEY `workflow_signal_records_signal_wait_id_index` (`signal_wait_id`),\n KEY `workflow_signal_records_status_index` (`status`),\n KEY `workflow_signal_records_outcome_index` (`outcome`),\n KEY `workflow_signal_records_command_sequence_index` (`command_sequence`),\n KEY `workflow_signal_records_workflow_sequence_index` (`workflow_sequence`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_tasks", + "CREATE TABLE `workflow_tasks` (\n `id` varchar(26) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `task_type` varchar(255) NOT NULL,\n `status` varchar(255) NOT NULL,\n `compatibility` varchar(255) DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),\n `connection` varchar(255) DEFAULT NULL,\n `queue` varchar(255) DEFAULT NULL,\n `priority` tinyint(3) unsigned NOT NULL DEFAULT 5,\n `fairness_key` varchar(64) DEFAULT NULL,\n `fairness_weight` smallint(5) unsigned NOT NULL DEFAULT 1,\n `sticky_worker_id` varchar(255) DEFAULT NULL,\n `sticky_until` timestamp(6) NULL DEFAULT NULL,\n `sticky_replay_mode` varchar(255) DEFAULT NULL,\n `sticky_claimed_at` timestamp(6) NULL DEFAULT NULL,\n `available_at` timestamp(6) NULL DEFAULT NULL,\n `leased_at` timestamp(6) NULL DEFAULT NULL,\n `lease_owner` varchar(255) DEFAULT NULL,\n `lease_expires_at` timestamp(6) NULL DEFAULT NULL,\n `attempt_count` int(10) unsigned NOT NULL DEFAULT 0,\n `last_dispatch_attempt_at` timestamp(6) NULL DEFAULT NULL,\n `last_dispatched_at` timestamp(6) NULL DEFAULT NULL,\n `last_dispatch_error` text DEFAULT NULL,\n `last_claim_failed_at` timestamp(6) NULL DEFAULT NULL,\n `last_claim_error` text DEFAULT NULL,\n `repair_count` int(10) unsigned NOT NULL DEFAULT 0,\n `repair_available_at` timestamp(6) NULL DEFAULT NULL,\n `last_error` text DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `ready_origin_at` datetime(6) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `workflow_tasks_status_available_at_index` (`status`,`available_at`),\n KEY `workflow_tasks_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_tasks_namespace_index` (`namespace`),\n KEY `workflow_tasks_sticky_worker_id_index` (`sticky_worker_id`),\n KEY `workflow_tasks_sticky_until_index` (`sticky_until`),\n KEY `workflow_tasks_sticky_replay_mode_index` (`sticky_replay_mode`),\n KEY `workflow_tasks_sticky_claimed_at_index` (`sticky_claimed_at`),\n KEY `workflow_tasks_dispatch_order_index` (`queue`,`status`,`priority`,`available_at`),\n KEY `workflow_tasks_namespace_queue_status_idx` (`namespace`,`queue`,`status`),\n KEY `workflow_tasks_fairness_class_index` (`queue`,`status`,`fairness_key`),\n KEY `workflow_tasks_prom_metrics_queue_idx` (`namespace`,`queue`),\n KEY `dw_workflow_tasks_poll` (`namespace`(64),`queue`(64),`task_type`(16),`status`(16),`available_at`),\n KEY `dw_workflow_tasks_scoped_dispatch` (`namespace`,`queue`,`task_type`(16),`status`(16),`priority`,`available_at`,`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_task_poll_cursors", + "CREATE TABLE `workflow_task_poll_cursors` (\n `namespace` varchar(128) NOT NULL,\n `task_queue` varchar(255) NOT NULL,\n `next_task_kind` varchar(32) NOT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`namespace`,`task_queue`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_updates", + "CREATE TABLE `workflow_updates` (\n `id` varchar(26) NOT NULL,\n `workflow_command_id` varchar(26) NOT NULL,\n `workflow_instance_id` varchar(191) DEFAULT NULL,\n `workflow_run_id` varchar(26) DEFAULT NULL,\n `target_scope` varchar(255) NOT NULL DEFAULT 'instance',\n `requested_workflow_run_id` varchar(26) DEFAULT NULL,\n `resolved_workflow_run_id` varchar(26) DEFAULT NULL,\n `update_name` varchar(255) NOT NULL,\n `status` varchar(255) NOT NULL,\n `outcome` varchar(255) DEFAULT NULL,\n `command_sequence` int(10) unsigned DEFAULT NULL,\n `workflow_sequence` int(10) unsigned DEFAULT NULL,\n `payload_codec` varchar(255) DEFAULT NULL,\n `arguments` longtext DEFAULT NULL,\n `result` longtext DEFAULT NULL,\n `validation_errors` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`validation_errors`)),\n `rejection_reason` varchar(255) DEFAULT NULL,\n `failure_id` varchar(26) DEFAULT NULL,\n `failure_message` text DEFAULT NULL,\n `accepted_at` timestamp(6) NULL DEFAULT NULL,\n `applied_at` timestamp(6) NULL DEFAULT NULL,\n `rejected_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_updates_workflow_command_id_unique` (`workflow_command_id`),\n KEY `workflow_updates_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_updates_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_updates_requested_workflow_run_id_index` (`requested_workflow_run_id`),\n KEY `workflow_updates_resolved_workflow_run_id_index` (`resolved_workflow_run_id`),\n KEY `workflow_updates_update_name_index` (`update_name`),\n KEY `workflow_updates_status_index` (`status`),\n KEY `workflow_updates_outcome_index` (`outcome`),\n KEY `workflow_updates_command_sequence_index` (`command_sequence`),\n KEY `workflow_updates_workflow_sequence_index` (`workflow_sequence`),\n KEY `workflow_updates_failure_id_index` (`failure_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_update_validation_tasks", + "CREATE TABLE `workflow_update_validation_tasks` (\n `id` varchar(26) NOT NULL,\n `idempotency_key` varchar(64) NOT NULL,\n `namespace` varchar(255) NOT NULL,\n `workflow_instance_id` varchar(191) NOT NULL,\n `workflow_run_id` varchar(26) NOT NULL,\n `workflow_type` varchar(255) NOT NULL,\n `task_queue` varchar(255) NOT NULL,\n `compatibility` varchar(255) DEFAULT NULL,\n `workflow_definition_fingerprint` varchar(255) DEFAULT NULL,\n `update_name` varchar(255) NOT NULL,\n `request_id` varchar(255) NOT NULL,\n `input_hash` varchar(64) NOT NULL,\n `payload_codec` varchar(255) NOT NULL,\n `arguments` longtext NOT NULL,\n `command_context` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`command_context`)),\n `status` varchar(255) NOT NULL,\n `attempt_count` int(10) unsigned NOT NULL DEFAULT 0,\n `lease_owner` varchar(255) DEFAULT NULL,\n `lease_expires_at` timestamp(6) NULL DEFAULT NULL,\n `rejection_reason` varchar(255) DEFAULT NULL,\n `rejection_message` text DEFAULT NULL,\n `failure_type` varchar(255) DEFAULT NULL,\n `validation_errors` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`validation_errors`)),\n `approved_at` timestamp(6) NULL DEFAULT NULL,\n `rejected_at` timestamp(6) NULL DEFAULT NULL,\n `failed_at` timestamp(6) NULL DEFAULT NULL,\n `timed_out_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_update_validation_tasks_idempotency_key_unique` (`idempotency_key`),\n KEY `workflow_update_validation_poll_index` (`namespace`,`task_queue`,`status`,`created_at`),\n KEY `workflow_update_validation_tasks_namespace_index` (`namespace`),\n KEY `workflow_update_validation_tasks_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_update_validation_tasks_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_update_validation_tasks_workflow_type_index` (`workflow_type`),\n KEY `workflow_update_validation_tasks_task_queue_index` (`task_queue`),\n KEY `workflow_update_validation_tasks_compatibility_index` (`compatibility`),\n KEY `workflow_update_validation_tasks_update_name_index` (`update_name`),\n KEY `workflow_update_validation_tasks_status_index` (`status`),\n KEY `workflow_update_validation_tasks_lease_owner_index` (`lease_owner`),\n KEY `workflow_update_validation_tasks_lease_expires_at_index` (`lease_expires_at`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_worker_build_id_rollouts", + "CREATE TABLE `workflow_worker_build_id_rollouts` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `namespace` varchar(128) NOT NULL,\n `task_queue` varchar(255) NOT NULL,\n `build_id` varchar(255) NOT NULL DEFAULT '',\n `drain_intent` varchar(32) NOT NULL DEFAULT 'active',\n `drained_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `promoted_at` timestamp NULL DEFAULT NULL,\n `rolled_back_at` timestamp NULL DEFAULT NULL,\n `required_compatibility` varchar(255) DEFAULT NULL,\n `recorded_fingerprint` varchar(255) DEFAULT NULL,\n `compatibility_policy` varchar(32) DEFAULT NULL,\n `workflow_types` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`workflow_types`)),\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_build_id_rollouts_scope_unique` (`namespace`,`task_queue`,`build_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_worker_compatibility_heartbeats", + "CREATE TABLE `workflow_worker_compatibility_heartbeats` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `worker_id` varchar(255) NOT NULL,\n `scope_key` varchar(64) NOT NULL,\n `namespace` varchar(255) DEFAULT NULL,\n `host` varchar(255) DEFAULT NULL,\n `process_id` varchar(255) DEFAULT NULL,\n `connection` varchar(255) DEFAULT NULL,\n `queue` varchar(255) DEFAULT NULL,\n `supported` longtext COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`supported`)),\n `recorded_at` datetime(6) NOT NULL,\n `expires_at` datetime(6) NOT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_worker_compatibility_heartbeats_scope_unique` (`worker_id`,`scope_key`),\n KEY `workflow_worker_compatibility_heartbeats_namespace_index` (`namespace`),\n KEY `workflow_worker_compatibility_heartbeats_connection_index` (`connection`),\n KEY `workflow_worker_compatibility_heartbeats_queue_index` (`queue`),\n KEY `workflow_worker_compatibility_heartbeats_expires_at_index` (`expires_at`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_worker_registrations", + "CREATE TABLE `workflow_worker_registrations` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `worker_id` varchar(255) NOT NULL,\n `namespace` varchar(128) NOT NULL,\n `task_queue` varchar(255) NOT NULL,\n `runtime` varchar(32) NOT NULL,\n `sdk_version` varchar(64) DEFAULT NULL,\n `build_id` varchar(255) DEFAULT NULL,\n `supported_workflow_types` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`supported_workflow_types`)),\n `workflow_definition_fingerprints` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`workflow_definition_fingerprints`)),\n `workflow_command_contracts` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`workflow_command_contracts`)),\n `supported_activity_types` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`supported_activity_types`)),\n `capabilities` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`capabilities`)),\n `capability_manifest` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`capability_manifest`)),\n `max_concurrent_workflow_tasks` int(10) unsigned NOT NULL DEFAULT 100,\n `max_concurrent_activity_tasks` int(10) unsigned NOT NULL DEFAULT 100,\n `max_concurrent_worker_sessions` int(10) unsigned NOT NULL DEFAULT 10,\n `available_workflow_slots` int(10) unsigned DEFAULT NULL,\n `available_activity_slots` int(10) unsigned DEFAULT NULL,\n `available_session_slots` int(10) unsigned DEFAULT NULL,\n `process_metrics` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`process_metrics`)),\n `heartbeat_interval_seconds` int(10) unsigned DEFAULT NULL,\n `last_heartbeat_at` timestamp NULL DEFAULT NULL,\n `status` varchar(32) NOT NULL DEFAULT 'active',\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_worker_registrations_worker_id_namespace_unique` (`worker_id`,`namespace`),\n KEY `workflow_worker_registrations_namespace_task_queue_status_index` (`namespace`,`task_queue`,`status`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_worker_sessions", + "CREATE TABLE `workflow_worker_sessions` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `namespace` varchar(128) NOT NULL,\n `session_id` varchar(255) NOT NULL,\n `connection` varchar(255) DEFAULT NULL,\n `queue` varchar(255) DEFAULT NULL,\n `requirements` longtext COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`requirements`)),\n `status` varchar(32) NOT NULL DEFAULT 'active',\n `lease_owner` varchar(255) DEFAULT NULL,\n `lease_expires_at` timestamp NULL DEFAULT NULL,\n `ttl_expires_at` timestamp NULL DEFAULT NULL,\n `closed_at` timestamp NULL DEFAULT NULL,\n `failure_reason` varchar(128) DEFAULT NULL,\n `lease_seconds` int(10) unsigned NOT NULL DEFAULT 120,\n `ttl_seconds` int(10) unsigned NOT NULL DEFAULT 1800,\n `max_concurrent_activities` int(10) unsigned NOT NULL DEFAULT 1,\n `create_if_missing` tinyint(1) NOT NULL DEFAULT 1,\n `allow_reacquire_after_failure` tinyint(1) NOT NULL DEFAULT 1,\n `last_heartbeat_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_worker_sessions_namespace_session_id_unique` (`namespace`,`session_id`),\n KEY `workflow_worker_sessions_namespace_status_index` (`namespace`,`status`),\n KEY `workflow_worker_sessions_namespace_lease_owner_status_index` (`namespace`,`lease_owner`,`status`),\n KEY `workflow_worker_sessions_namespace_queue_status_index` (`namespace`,`queue`,`status`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "_sqlx_migrations", + "CREATE TABLE `_sqlx_migrations` (\n `version` bigint(20) NOT NULL,\n `description` text NOT NULL,\n `installed_on` timestamp NOT NULL DEFAULT current_timestamp(),\n `success` tinyint(1) NOT NULL,\n `checksum` blob NOT NULL,\n `execution_time` bigint(20) NOT NULL,\n PRIMARY KEY (`version`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ] +] diff --git a/rust/migrations/mariadb/0016_external_storage_bindings.sql b/rust/migrations/mariadb/0016_external_storage_bindings.sql new file mode 100644 index 000000000..edab43a8a --- /dev/null +++ b/rust/migrations/mariadb/0016_external_storage_bindings.sql @@ -0,0 +1,3 @@ +-- Original object authority survives namespace write-policy changes. +ALTER TABLE runtime_external_payloads ADD COLUMN storage_binding TEXT NULL; +ALTER TABLE workflow_namespaces ADD COLUMN external_payload_storage_generation BIGINT NOT NULL DEFAULT 0; diff --git a/rust/migrations/mysql/0016_checksum.txt b/rust/migrations/mysql/0016_checksum.txt new file mode 100644 index 000000000..25fb9022a --- /dev/null +++ b/rust/migrations/mysql/0016_checksum.txt @@ -0,0 +1 @@ +86874ee8d0085f10eed4caa2f3098d1eff7d11eca74ae428991ab2eb4a5eddead0106bb58cd94ca864357af511099126 diff --git a/rust/migrations/mysql/0017_catalog.json b/rust/migrations/mysql/0017_catalog.json new file mode 100644 index 000000000..51f012d17 --- /dev/null +++ b/rust/migrations/mysql/0017_catalog.json @@ -0,0 +1,254 @@ +[ + [ + "_sqlx_migrations", + "CREATE TABLE `_sqlx_migrations` (\n `version` bigint NOT NULL,\n `description` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `installed_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `success` tinyint(1) NOT NULL,\n `checksum` blob NOT NULL,\n `execution_time` bigint NOT NULL,\n PRIMARY KEY (`version`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "activity_attempts", + "CREATE TABLE `activity_attempts` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `activity_execution_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_task_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `worker_attempt_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `attempt_number` int unsigned NOT NULL,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `lease_owner` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `started_at` timestamp(6) NOT NULL,\n `last_heartbeat_at` timestamp(6) NULL DEFAULT NULL,\n `lease_expires_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `activity_attempts_activity_execution_id_attempt_number_unique` (`activity_execution_id`,`attempt_number`),\n KEY `activity_attempts_workflow_run_id_index` (`workflow_run_id`),\n KEY `activity_attempts_activity_execution_id_index` (`activity_execution_id`),\n KEY `activity_attempts_workflow_task_id_index` (`workflow_task_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "activity_executions", + "CREATE TABLE `activity_executions` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `sequence` int unsigned NOT NULL,\n `activity_class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `activity_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `payload_codec` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `arguments` longtext COLLATE utf8mb4_unicode_ci,\n `result` longtext COLLATE utf8mb4_unicode_ci,\n `exception` longtext COLLATE utf8mb4_unicode_ci,\n `connection` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `queue` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `attempt_count` int unsigned NOT NULL DEFAULT '1',\n `current_attempt_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `retry_policy` longtext COLLATE utf8mb4_bin,\n `parallel_group_path` longtext COLLATE utf8mb4_bin,\n `activity_options` longtext COLLATE utf8mb4_bin,\n `schedule_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `close_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `schedule_to_close_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `heartbeat_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `last_heartbeat_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `activity_executions_workflow_run_id_sequence_unique` (`workflow_run_id`,`sequence`),\n KEY `activity_executions_workflow_run_id_index` (`workflow_run_id`),\n KEY `activity_exec_prom_metrics_series_idx` (`workflow_run_id`,`queue`,`activity_type`),\n CONSTRAINT `dw_json_text_5f011f3fc9ed1cbf3798` CHECK (json_valid(`activity_options`)),\n CONSTRAINT `dw_json_text_b0ad277df9011ce8dcd8` CHECK (json_valid(`parallel_group_path`)),\n CONSTRAINT `dw_json_text_da40cddf645f92a0f5d3` CHECK (json_valid(`retry_policy`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_command_intents", + "CREATE TABLE `dw_command_intents` (\n `command_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `intent_digest` varchar(71) COLLATE utf8mb4_unicode_ci NOT NULL,\n PRIMARY KEY (`command_id`),\n KEY `dw_command_intents_namespace` (`namespace`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_external_payload_deletions", + "CREATE TABLE `dw_external_payload_deletions` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `storage_uri` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `storage_uri_sha256` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `storage_policy` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `attempts` bigint NOT NULL DEFAULT '0',\n `failure_code` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `dw_external_payload_deletions_uri` (`namespace`,`storage_uri_sha256`),\n KEY `dw_external_payload_deletions_due` (`namespace`,`updated_at`,`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_poll_receipts", + "CREATE TABLE `dw_poll_receipts` (\n `namespace` varchar(255) COLLATE utf8mb4_0900_bin NOT NULL,\n `worker_id` varchar(255) COLLATE utf8mb4_0900_bin NOT NULL,\n `kind` varchar(8) COLLATE ascii_bin NOT NULL,\n `request_id` varchar(255) COLLATE utf8mb4_0900_bin NOT NULL,\n `task_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `attempt` bigint NOT NULL,\n `response` longtext COLLATE utf8mb4_bin NOT NULL,\n `expires_at` timestamp(6) NOT NULL,\n PRIMARY KEY (`namespace`,`worker_id`,`kind`,`request_id`),\n KEY `dw_poll_receipts_task` (`task_id`),\n KEY `dw_poll_receipts_expiration` (`expires_at`),\n CONSTRAINT `dw_poll_receipts_task` FOREIGN KEY (`task_id`) REFERENCES `workflow_tasks` (`id`) ON DELETE CASCADE,\n CONSTRAINT `dw_json_text_b5a74d059c497aac89e1` CHECK (json_valid(`response`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin" + ], + [ + "dw_query_cache", + "CREATE TABLE `dw_query_cache` (\n `key` varchar(64) COLLATE utf8mb4_bin NOT NULL,\n `value` longtext COLLATE utf8mb4_bin NOT NULL,\n `expiration` bigint NOT NULL,\n PRIMARY KEY (`key`),\n KEY `dw_query_cache_expiration` (`expiration`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" + ], + [ + "dw_run_command_contracts", + "CREATE TABLE `dw_run_command_contracts` (\n `workflow_run_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `contract` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `worker_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_task_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `bound_at` datetime(6) NOT NULL,\n PRIMARY KEY (`workflow_run_id`),\n KEY `dw_run_command_contracts_namespace` (`namespace`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_server_schema", + "CREATE TABLE `dw_server_schema` (\n `engine` varchar(64) COLLATE utf8mb4_bin NOT NULL,\n `version` bigint NOT NULL,\n `bootstrap_checksum` varbinary(48) NOT NULL,\n PRIMARY KEY (`engine`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" + ], + [ + "dw_service_admission_counters", + "CREATE TABLE `dw_service_admission_counters` (\n `cache_key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `amount` bigint NOT NULL,\n `expires_at` datetime(6) NOT NULL,\n PRIMARY KEY (`cache_key`),\n KEY `dw_service_admission_counters_expiry` (`expires_at`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_service_call_deadlines", + "CREATE TABLE `dw_service_call_deadlines` (\n `service_call_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `call_deadline_at` datetime(6) NOT NULL,\n PRIMARY KEY (`service_call_id`),\n KEY `dw_service_call_deadlines_due` (`call_deadline_at`,`service_call_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_stream_reclaims", + "CREATE TABLE `dw_stream_reclaims` (\n `stream_id` bigint unsigned NOT NULL,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `reclaim_at` datetime(6) NOT NULL,\n PRIMARY KEY (`stream_id`),\n KEY `dw_stream_reclaims_due` (`namespace`,`reclaim_at`,`stream_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_task_completions", + "CREATE TABLE `dw_task_completions` (\n `task_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `receipt` longtext COLLATE utf8mb4_bin NOT NULL,\n PRIMARY KEY (`task_id`),\n CONSTRAINT `dw_task_completions_task` FOREIGN KEY (`task_id`) REFERENCES `workflow_tasks` (`id`) ON DELETE CASCADE,\n CONSTRAINT `dw_json_text_49816cb4519d3d981518` CHECK (json_valid(`receipt`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_task_queue_pauses", + "CREATE TABLE `dw_task_queue_pauses` (\n `namespace` varchar(191) COLLATE utf8mb4_bin NOT NULL,\n `task_queue` varchar(255) COLLATE utf8mb4_bin NOT NULL,\n `reason` text COLLATE utf8mb4_unicode_ci,\n `paused_by` text COLLATE utf8mb4_unicode_ci,\n `paused_at` datetime(6) NOT NULL,\n `resumed_by` text COLLATE utf8mb4_unicode_ci,\n `resumed_at` datetime(6) DEFAULT NULL,\n PRIMARY KEY (`namespace`,`task_queue`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_worker_registration_incarnations", + "CREATE TABLE `dw_worker_registration_incarnations` (\n `token` char(32) COLLATE ascii_bin NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `worker_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `status` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,\n `recovered_workflow_task_count` bigint DEFAULT NULL,\n `finished_at` datetime(6) DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`token`),\n KEY `dw_worker_incarnation_authority` (`namespace`,`worker_id`,`status`),\n KEY `dw_worker_incarnation_retention` (`status`,`finished_at`),\n CONSTRAINT `dw_worker_incarnation_state` CHECK ((((`status` = _utf8mb4'active') and (`finished_at` is null) and (`recovered_workflow_task_count` is null)) or ((`status` = _utf8mb4'superseded') and (`finished_at` is not null) and (`recovered_workflow_task_count` is null)) or ((`status` = _utf8mb4'deregistered') and (`finished_at` is not null) and (`recovered_workflow_task_count` is not null) and (`recovered_workflow_task_count` >= 0))))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "dw_worker_session_holders", + "CREATE TABLE `dw_worker_session_holders` (\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `session_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `incarnation` char(64) COLLATE ascii_bin NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`namespace`,`session_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "failed_jobs", + "CREATE TABLE `failed_jobs` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`),\n UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "jobs", + "CREATE TABLE `jobs` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `attempts` tinyint unsigned NOT NULL,\n `reserved_at` int unsigned DEFAULT NULL,\n `available_at` int unsigned NOT NULL,\n `created_at` int unsigned NOT NULL,\n PRIMARY KEY (`id`),\n KEY `jobs_queue_index` (`queue`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "migrations", + "CREATE TABLE `migrations` (\n `id` int unsigned NOT NULL AUTO_INCREMENT,\n `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `batch` int NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_credentials", + "CREATE TABLE `runtime_credentials` (\n `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `roles` longtext COLLATE utf8mb4_bin NOT NULL,\n `tenant` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `claims` longtext COLLATE utf8mb4_bin,\n `token_prefix` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL,\n `token_hash` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `expires_at` timestamp NULL DEFAULT NULL,\n `revoked_at` timestamp NULL DEFAULT NULL,\n `rotated_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `runtime_credentials_token_hash_unique` (`token_hash`),\n KEY `runtime_credentials_tenant_index` (`tenant`),\n KEY `runtime_credentials_expires_at_index` (`expires_at`),\n KEY `runtime_credentials_revoked_at_index` (`revoked_at`),\n CONSTRAINT `dw_json_text_075fecde0a757510fdf7` CHECK (json_valid(`roles`)),\n CONSTRAINT `dw_json_text_5f7fdbad00226a90f331` CHECK (json_valid(`claims`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_external_payload_backup_hold", + "CREATE TABLE `runtime_external_payload_backup_hold` (\n `id` tinyint unsigned NOT NULL,\n `owner` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `acquired_at` timestamp NULL DEFAULT NULL,\n `expires_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_external_payload_cleanup_stats", + "CREATE TABLE `runtime_external_payload_cleanup_stats` (\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `passes_total` bigint unsigned NOT NULL DEFAULT '0',\n `deleted_references_total` bigint unsigned NOT NULL DEFAULT '0',\n `deleted_backing_objects_total` bigint unsigned NOT NULL DEFAULT '0',\n `shared_objects_preserved_total` bigint unsigned NOT NULL DEFAULT '0',\n `blocked_outcomes_total` bigint unsigned NOT NULL DEFAULT '0',\n `storage_driver_failures_total` bigint unsigned NOT NULL DEFAULT '0',\n `last_processed` int unsigned NOT NULL DEFAULT '0',\n `last_deleted_references` int unsigned NOT NULL DEFAULT '0',\n `last_deleted_backing_objects` int unsigned NOT NULL DEFAULT '0',\n `last_shared_objects_preserved` int unsigned NOT NULL DEFAULT '0',\n `last_blocked_outcomes` int unsigned NOT NULL DEFAULT '0',\n `last_storage_driver_failures` int unsigned NOT NULL DEFAULT '0',\n `last_pass_status` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `last_completed_at` timestamp NULL DEFAULT NULL,\n `last_storage_failure_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`namespace`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_external_payload_object_locks", + "CREATE TABLE `runtime_external_payload_object_locks` (\n `bucket` smallint unsigned NOT NULL,\n PRIMARY KEY (`bucket`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_external_payloads", + "CREATE TABLE `runtime_external_payloads` (\n `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `storage_uri` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `storage_uri_sha256` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `codec` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `sha256` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `size_bytes` bigint unsigned NOT NULL,\n `upload_status` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ready',\n `retained_at` timestamp NULL DEFAULT NULL,\n `expires_at` timestamp NULL DEFAULT NULL,\n `last_fetched_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `storage_binding` text COLLATE utf8mb4_unicode_ci,\n PRIMARY KEY (`id`),\n UNIQUE KEY `runtime_external_payloads_namespace_uri_unique` (`namespace`,`storage_uri_sha256`),\n KEY `runtime_external_payloads_namespace_index` (`namespace`),\n KEY `runtime_external_payloads_expires_at_index` (`expires_at`),\n KEY `runtime_external_payloads_reclamation_idx` (`retained_at`,`expires_at`,`upload_status`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "runtime_payload_completion_budgets", + "CREATE TABLE `runtime_payload_completion_budgets` (\n `id` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `context` longtext COLLATE utf8mb4_bin NOT NULL,\n `slots` longtext COLLATE utf8mb4_bin NOT NULL,\n `objects` longtext COLLATE utf8mb4_bin NOT NULL,\n `expires_at` timestamp NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `runtime_payload_completion_budgets_namespace_index` (`namespace`),\n KEY `runtime_payload_completion_budgets_expires_at_index` (`expires_at`),\n CONSTRAINT `dw_json_text_4077efaae491546bebc7` CHECK (json_valid(`slots`)),\n CONSTRAINT `dw_json_text_c185060f2dbee09c5a6a` CHECK (json_valid(`objects`)),\n CONSTRAINT `dw_json_text_d1bf52994d698d7d04ed` CHECK (json_valid(`context`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "search_attribute_definitions", + "CREATE TABLE `search_attribute_definitions` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `type` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `search_attribute_definitions_namespace_name_unique` (`namespace`,`name`),\n KEY `search_attribute_definitions_namespace_index` (`namespace`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_child_calls", + "CREATE TABLE `workflow_child_calls` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `parent_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `parent_workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `sequence` int unsigned NOT NULL,\n `child_workflow_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `child_workflow_class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `requested_child_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resolved_child_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resolved_child_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `parent_close_policy` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'abandon',\n `connection` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `queue` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `compatibility` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `retry_policy` longtext COLLATE utf8mb4_bin,\n `timeout_policy` longtext COLLATE utf8mb4_bin,\n `cancellation_propagation` tinyint(1) NOT NULL DEFAULT '0',\n `status` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'scheduled',\n `result_payload_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `failure_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `closed_reason` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `scheduled_at` timestamp(6) NOT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `arguments` longtext COLLATE utf8mb4_bin,\n `metadata` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `child_calls_parent_seq` (`parent_workflow_run_id`,`sequence`),\n KEY `child_calls_parent_status` (`parent_workflow_run_id`,`status`),\n KEY `child_calls_child_parent` (`resolved_child_instance_id`,`parent_workflow_run_id`),\n KEY `workflow_child_calls_parent_workflow_run_id_index` (`parent_workflow_run_id`),\n KEY `workflow_child_calls_parent_workflow_instance_id_index` (`parent_workflow_instance_id`),\n KEY `workflow_child_calls_sequence_index` (`sequence`),\n KEY `workflow_child_calls_resolved_child_instance_id_index` (`resolved_child_instance_id`),\n KEY `workflow_child_calls_resolved_child_run_id_index` (`resolved_child_run_id`),\n KEY `workflow_child_calls_status_index` (`status`),\n CONSTRAINT `workflow_child_calls_parent_workflow_run_id_foreign` FOREIGN KEY (`parent_workflow_run_id`) REFERENCES `workflow_runs` (`id`) ON DELETE CASCADE,\n CONSTRAINT `dw_json_text_016208f3b76c51671353` CHECK (json_valid(`metadata`)),\n CONSTRAINT `dw_json_text_40e45e4f94944c511ab5` CHECK (json_valid(`timeout_policy`)),\n CONSTRAINT `dw_json_text_55a3cac14b0a3feca840` CHECK (json_valid(`retry_policy`)),\n CONSTRAINT `dw_json_text_9c078ba0f6c256bb7d9c` CHECK (json_valid(`arguments`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_child_projection_repairs", + "CREATE TABLE `workflow_child_projection_repairs` (\n `workflow_history_event_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_task_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `history_sequence` int unsigned NOT NULL,\n `failure_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `failed_child_counted_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`workflow_history_event_id`),\n KEY `workflow_child_projection_repairs_drain_idx` (`workflow_run_id`,`workflow_task_id`,`history_sequence`),\n KEY `workflow_child_projection_repairs_failure_idx` (`workflow_run_id`,`failure_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_commands", + "CREATE TABLE `workflow_commands` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `requested_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resolved_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `command_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `target_scope` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'instance',\n `source` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'php',\n `context` longtext COLLATE utf8mb4_bin,\n `request_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `outcome` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_class` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload_codec` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_unicode_ci,\n `rejection_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `command_sequence` int unsigned DEFAULT NULL,\n `message_sequence` int unsigned DEFAULT NULL,\n `accepted_at` timestamp(6) NULL DEFAULT NULL,\n `applied_at` timestamp(6) NULL DEFAULT NULL,\n `rejected_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_commands_request_lookup` (`workflow_instance_id`,`command_type`,`request_id`),\n KEY `workflow_commands_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_commands_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_commands_requested_workflow_run_id_index` (`requested_workflow_run_id`),\n KEY `workflow_commands_resolved_workflow_run_id_index` (`resolved_workflow_run_id`),\n KEY `workflow_commands_command_type_index` (`command_type`),\n KEY `workflow_commands_source_index` (`source`),\n KEY `workflow_commands_status_index` (`status`),\n KEY `workflow_commands_command_sequence_index` (`command_sequence`),\n CONSTRAINT `dw_json_text_1365410084c0cd12ed37` CHECK (json_valid(`context`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_durable_stream_items", + "CREATE TABLE `workflow_durable_stream_items` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `stream_id` bigint unsigned NOT NULL,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stream_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `offset` bigint NOT NULL,\n `idempotency_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `origin` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'workflow_command',\n `origin_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin,\n `payload_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload_codec` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `item_type` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `content_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `emitted_at` timestamp(6) NOT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_durable_stream_items_stream_offset_unique` (`stream_id`,`offset`),\n UNIQUE KEY `wf_durable_stream_items_idempotency_unique` (`stream_id`,`idempotency_key`),\n KEY `wf_durable_stream_items_run_name_offset_idx` (`workflow_run_id`,`stream_name`,`offset`),\n KEY `workflow_durable_stream_items_namespace_index` (`namespace`),\n KEY `workflow_durable_stream_items_workflow_run_id_index` (`workflow_run_id`),\n CONSTRAINT `workflow_durable_stream_items_stream_id_foreign` FOREIGN KEY (`stream_id`) REFERENCES `workflow_durable_streams` (`id`) ON DELETE CASCADE,\n CONSTRAINT `dw_json_text_9d624f24054e91d9250f` CHECK (json_valid(`payload`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_durable_streams", + "CREATE TABLE `workflow_durable_streams` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stream_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `status` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',\n `last_offset` bigint NOT NULL DEFAULT '-1',\n `total_items` bigint unsigned NOT NULL DEFAULT '0',\n `retention_seconds` int unsigned DEFAULT NULL,\n `opened_at` timestamp(6) NULL DEFAULT NULL,\n `last_appended_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `error_reason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `pending_items` bigint unsigned NOT NULL DEFAULT '0',\n `metadata` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_durable_streams_run_name_unique` (`workflow_run_id`,`stream_name`),\n KEY `wf_durable_streams_ns_instance_name_idx` (`namespace`,`workflow_instance_id`,`stream_name`),\n KEY `wf_durable_streams_ns_status_idx` (`namespace`,`status`),\n KEY `workflow_durable_streams_namespace_index` (`namespace`),\n KEY `workflow_durable_streams_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_durable_streams_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_durable_streams_status_index` (`status`),\n CONSTRAINT `dw_json_text_da0f067f234347705b1c` CHECK (json_valid(`metadata`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_failures", + "CREATE TABLE `workflow_failures` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `source_kind` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `source_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `propagation_kind` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `failure_category` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `non_retryable` tinyint(1) NOT NULL DEFAULT '0',\n `handled` tinyint(1) NOT NULL DEFAULT '0',\n `exception_class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `message` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `file` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `line` int unsigned DEFAULT NULL,\n `trace_preview` longtext COLLATE utf8mb4_unicode_ci,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `workflow_failures_source_kind_source_id_index` (`source_kind`,`source_id`),\n KEY `workflow_failures_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_failures_failure_category_index` (`failure_category`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_history_events", + "CREATE TABLE `workflow_history_events` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `sequence` int unsigned NOT NULL,\n `event_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `payload` longtext COLLATE utf8mb4_bin,\n `workflow_task_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_command_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `recorded_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `recorded_at_utc` datetime(6) DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_history_events_workflow_run_id_sequence_unique` (`workflow_run_id`,`sequence`),\n KEY `workflow_history_events_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_history_events_workflow_task_id_index` (`workflow_task_id`),\n KEY `workflow_history_events_workflow_command_id_index` (`workflow_command_id`),\n CONSTRAINT `dw_json_text_186a93a5a54b983f2444` CHECK (json_valid(`payload`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_inbound_stream_items", + "CREATE TABLE `workflow_inbound_stream_items` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `stream_id` bigint unsigned NOT NULL,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stream_name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `message_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `position` bigint unsigned NOT NULL,\n `payload_codec` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,\n `payload_blob` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `payload_hash` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `delivered_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_command_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `delivered_at` timestamp(6) NULL DEFAULT NULL,\n `consumed_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `consumed_task_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `consumed_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `payload_released_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_inbound_items_stream_message_unique` (`stream_id`,`message_id`),\n UNIQUE KEY `wf_inbound_items_stream_position_unique` (`stream_id`,`position`),\n KEY `wf_inbound_items_ns_instance_name_position_idx` (`namespace`,`workflow_instance_id`,`stream_name`,`position`),\n KEY `workflow_inbound_stream_items_namespace_index` (`namespace`),\n KEY `workflow_inbound_stream_items_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_inbound_stream_items_delivered_run_id_index` (`delivered_run_id`),\n KEY `workflow_inbound_stream_items_workflow_command_id_index` (`workflow_command_id`),\n KEY `workflow_inbound_stream_items_consumed_run_id_index` (`consumed_run_id`),\n KEY `workflow_inbound_stream_items_consumed_task_id_index` (`consumed_task_id`),\n KEY `workflow_inbound_stream_items_payload_released_at_index` (`payload_released_at`),\n CONSTRAINT `workflow_inbound_stream_items_stream_id_foreign` FOREIGN KEY (`stream_id`) REFERENCES `workflow_inbound_streams` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_inbound_streams", + "CREATE TABLE `workflow_inbound_streams` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stream_name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `last_position` bigint unsigned NOT NULL DEFAULT '0',\n `cursor_position` bigint unsigned NOT NULL DEFAULT '0',\n `cursor_checkpoint_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `waiting_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `waiting_after_position` bigint unsigned DEFAULT NULL,\n `waiting_since` timestamp(6) NULL DEFAULT NULL,\n `duplicate_count` bigint unsigned NOT NULL DEFAULT '0',\n `malformed_count` bigint unsigned NOT NULL DEFAULT '0',\n `last_input_outcome` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `last_input_message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `last_input_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `cleanup_blocked_at` timestamp(6) NULL DEFAULT NULL,\n `cleanup_blocked_reason` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `cleanup_blocked_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_inbound_streams_ns_instance_name_unique` (`namespace`,`workflow_instance_id`,`stream_name`),\n KEY `workflow_inbound_streams_namespace_index` (`namespace`),\n KEY `workflow_inbound_streams_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_inbound_streams_cursor_checkpoint_run_id_index` (`cursor_checkpoint_run_id`),\n KEY `workflow_inbound_streams_waiting_run_id_index` (`waiting_run_id`),\n KEY `workflow_inbound_streams_cleanup_blocked_run_id_index` (`cleanup_blocked_run_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_instances", + "CREATE TABLE `workflow_instances` (\n `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `business_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `visibility_labels` longtext COLLATE utf8mb4_bin,\n `memo` longtext COLLATE utf8mb4_bin,\n `execution_timeout_seconds` int unsigned DEFAULT NULL,\n `current_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `run_count` int unsigned NOT NULL DEFAULT '0',\n `last_message_sequence` int unsigned NOT NULL DEFAULT '0',\n `reserved_at` timestamp(6) NULL DEFAULT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `workflow_instances_namespace_index` (`namespace`),\n KEY `workflow_instances_business_key_index` (`business_key`),\n KEY `workflow_instances_current_run_id_index` (`current_run_id`),\n CONSTRAINT `dw_json_text_4d686a7e3879bc8d7c6c` CHECK (json_valid(`memo`)),\n CONSTRAINT `dw_json_text_5dec5cdd6359edc700f2` CHECK (json_valid(`visibility_labels`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_links", + "CREATE TABLE `workflow_links` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `link_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `sequence` int unsigned DEFAULT NULL,\n `parallel_group_path` longtext COLLATE utf8mb4_bin,\n `parent_workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `parent_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `child_workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `child_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `is_primary_parent` tinyint(1) NOT NULL DEFAULT '0',\n `parent_close_policy` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'abandon',\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_links_parent_child_type_unique` (`parent_workflow_run_id`,`child_workflow_run_id`,`link_type`),\n KEY `workflow_links_parent_sequence_type_index` (`parent_workflow_run_id`,`sequence`,`link_type`),\n KEY `workflow_links_parent_workflow_instance_id_index` (`parent_workflow_instance_id`),\n KEY `workflow_links_parent_workflow_run_id_index` (`parent_workflow_run_id`),\n KEY `workflow_links_child_workflow_instance_id_index` (`child_workflow_instance_id`),\n KEY `workflow_links_child_workflow_run_id_index` (`child_workflow_run_id`),\n CONSTRAINT `dw_json_text_c6fec96f4176ab012436` CHECK (json_valid(`parallel_group_path`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_memos", + "CREATE TABLE `workflow_memos` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `value` longtext COLLATE utf8mb4_bin NOT NULL,\n `upserted_at_sequence` int unsigned NOT NULL,\n `inherited_from_parent` tinyint(1) NOT NULL DEFAULT '0',\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `portable_value` longtext COLLATE utf8mb4_bin,\n `portable_value_sequence` int unsigned DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_memos_run_key_unique` (`workflow_run_id`,`key`),\n KEY `workflow_memos_instance_key` (`workflow_instance_id`,`key`),\n CONSTRAINT `workflow_memos_workflow_run_id_foreign` FOREIGN KEY (`workflow_run_id`) REFERENCES `workflow_runs` (`id`) ON DELETE CASCADE,\n CONSTRAINT `dw_json_text_71688955589bdaf8f5c4` CHECK (json_valid(`portable_value`)),\n CONSTRAINT `dw_json_text_fcdcfa03c1ad3583628c` CHECK (json_valid(`value`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_messages", + "CREATE TABLE `workflow_messages` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `direction` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL,\n `channel` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stream_key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `sequence` bigint unsigned NOT NULL,\n `source_workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `source_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `target_workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `target_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `correlation_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `idempotency_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `consume_state` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',\n `consumed_at` timestamp(6) NULL DEFAULT NULL,\n `consumed_by_sequence` int unsigned DEFAULT NULL,\n `expires_at` timestamp(6) NULL DEFAULT NULL,\n `delivery_attempt_count` int unsigned NOT NULL DEFAULT '0',\n `last_delivery_attempt_at` timestamp(6) NULL DEFAULT NULL,\n `last_delivery_error` text COLLATE utf8mb4_unicode_ci,\n `metadata` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_msgs_stream_seq_unique` (`workflow_instance_id`,`stream_key`,`sequence`),\n KEY `wf_msgs_instance_stream_seq` (`workflow_instance_id`,`stream_key`,`sequence`),\n KEY `wf_msgs_run_dir_state` (`workflow_run_id`,`direction`,`consume_state`),\n KEY `wf_msgs_stream_seq_state` (`stream_key`,`sequence`,`consume_state`),\n KEY `wf_msgs_target_state` (`target_workflow_instance_id`,`consume_state`),\n KEY `workflow_messages_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_messages_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_messages_direction_index` (`direction`),\n KEY `workflow_messages_channel_index` (`channel`),\n KEY `workflow_messages_stream_key_index` (`stream_key`),\n KEY `workflow_messages_sequence_index` (`sequence`),\n KEY `workflow_messages_source_workflow_instance_id_index` (`source_workflow_instance_id`),\n KEY `workflow_messages_target_workflow_instance_id_index` (`target_workflow_instance_id`),\n KEY `workflow_messages_correlation_id_index` (`correlation_id`),\n KEY `workflow_messages_idempotency_key_index` (`idempotency_key`),\n KEY `workflow_messages_consume_state_index` (`consume_state`),\n CONSTRAINT `workflow_messages_workflow_run_id_foreign` FOREIGN KEY (`workflow_run_id`) REFERENCES `workflow_runs` (`id`) ON DELETE CASCADE,\n CONSTRAINT `dw_json_text_b0a2ae51e86f4f80b9fb` CHECK (json_valid(`metadata`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_namespaces", + "CREATE TABLE `workflow_namespaces` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `retention_mode` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'bounded',\n `retention_days` int unsigned DEFAULT '30',\n `status` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',\n `external_payload_storage` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `external_payload_storage_generation` bigint NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_namespaces_name_unique` (`name`),\n CONSTRAINT `dw_json_text_4281ef3e52494643312f` CHECK (json_valid(`external_payload_storage`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_lineage_entries", + "CREATE TABLE `workflow_run_lineage_entries` (\n `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `direction` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `lineage_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `position` int unsigned NOT NULL,\n `link_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `child_call_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `sequence` int unsigned DEFAULT NULL,\n `is_primary_parent` tinyint(1) NOT NULL DEFAULT '0',\n `related_workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `related_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `related_run_number` int unsigned DEFAULT NULL,\n `related_workflow_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `related_workflow_class` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `status_bucket` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `closed_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `linked_at` timestamp(6) NULL DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_run_lineage_run_direction_lineage_unique` (`workflow_run_id`,`direction`,`lineage_id`),\n KEY `workflow_run_lineage_run_direction_position_index` (`workflow_run_id`,`direction`,`position`),\n KEY `workflow_run_lineage_instance_direction_type_index` (`workflow_instance_id`,`direction`,`link_type`),\n KEY `workflow_run_lineage_entries_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_run_lineage_entries_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_run_lineage_entries_direction_index` (`direction`),\n KEY `workflow_run_lineage_entries_link_type_index` (`link_type`),\n KEY `workflow_run_lineage_entries_child_call_id_index` (`child_call_id`),\n KEY `workflow_run_lineage_entries_sequence_index` (`sequence`),\n KEY `workflow_run_lineage_entries_is_primary_parent_index` (`is_primary_parent`),\n KEY `workflow_run_lineage_entries_related_workflow_instance_id_index` (`related_workflow_instance_id`),\n KEY `workflow_run_lineage_entries_related_workflow_run_id_index` (`related_workflow_run_id`),\n KEY `workflow_run_lineage_entries_related_workflow_type_index` (`related_workflow_type`),\n KEY `workflow_run_lineage_entries_status_index` (`status`),\n KEY `workflow_run_lineage_entries_status_bucket_index` (`status_bucket`),\n KEY `workflow_run_lineage_entries_closed_reason_index` (`closed_reason`),\n KEY `workflow_run_lineage_entries_linked_at_index` (`linked_at`),\n CONSTRAINT `dw_json_text_1874a82e6e4c5698bc68` CHECK (json_valid(`payload`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_summaries", + "CREATE TABLE `workflow_run_summaries` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `run_number` int unsigned NOT NULL,\n `is_current_run` tinyint(1) NOT NULL DEFAULT '0',\n `engine_source` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'v2',\n `projection_schema_version` smallint unsigned DEFAULT NULL,\n `class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `compatibility` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `declared_entry_mode` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `declared_contract_source` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `business_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `visibility_labels` longtext COLLATE utf8mb4_bin,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `status_bucket` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `closed_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `connection` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `queue` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `sort_timestamp` timestamp(6) NULL DEFAULT NULL,\n `sort_key` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `archived_at` timestamp(6) NULL DEFAULT NULL,\n `archive_command_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `archive_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `duration_ms` bigint DEFAULT NULL,\n `wait_kind` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `wait_reason` text COLLATE utf8mb4_unicode_ci,\n `wait_started_at` timestamp(6) NULL DEFAULT NULL,\n `wait_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `open_wait_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resume_source_kind` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resume_source_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `next_task_at` timestamp(6) NULL DEFAULT NULL,\n `liveness_state` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `liveness_reason` text COLLATE utf8mb4_unicode_ci,\n `repair_blocked_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `repair_attention` tinyint(1) NOT NULL DEFAULT '0',\n `task_problem` tinyint(1) NOT NULL DEFAULT '0',\n `next_task_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `next_task_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `next_task_status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `next_task_lease_expires_at` timestamp(6) NULL DEFAULT NULL,\n `exception_count` int unsigned NOT NULL DEFAULT '0',\n `history_event_count` int unsigned NOT NULL DEFAULT '0',\n `history_size_bytes` bigint unsigned NOT NULL DEFAULT '0',\n `history_fan_out` int unsigned NOT NULL DEFAULT '0',\n `continue_as_new_recommended` tinyint(1) NOT NULL DEFAULT '0',\n `history_budget_pressure` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ok',\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `workflow_run_summaries_status_bucket_started_at_index` (`status_bucket`,`started_at`),\n KEY `workflow_run_summaries_sort_order_index` (`sort_timestamp`,`id`),\n KEY `wfrs_namespace_sort_idx` (`namespace`,`sort_timestamp`,`id`),\n KEY `wfrs_namespace_type_sort_idx` (`namespace`,`workflow_type`,`sort_timestamp`,`id`),\n KEY `wfrs_namespace_status_sort_idx` (`namespace`,`status_bucket`,`sort_timestamp`,`id`),\n KEY `workflow_run_summaries_sort_key_index` (`sort_key`),\n KEY `workflow_run_summaries_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_run_summaries_is_current_run_index` (`is_current_run`),\n KEY `workflow_run_summaries_projection_schema_version_index` (`projection_schema_version`),\n KEY `workflow_run_summaries_namespace_index` (`namespace`),\n KEY `wfrs_decl_entry_mode_idx` (`declared_entry_mode`),\n KEY `wfrs_decl_contract_source_idx` (`declared_contract_source`),\n KEY `workflow_run_summaries_business_key_index` (`business_key`),\n KEY `workflow_run_summaries_status_index` (`status`),\n KEY `workflow_run_summaries_status_bucket_index` (`status_bucket`),\n KEY `workflow_run_summaries_archived_at_index` (`archived_at`),\n KEY `workflow_run_summaries_archive_command_id_index` (`archive_command_id`),\n KEY `workflow_run_summaries_repair_blocked_reason_index` (`repair_blocked_reason`),\n KEY `workflow_run_summaries_repair_attention_index` (`repair_attention`),\n KEY `workflow_run_summaries_continue_as_new_recommended_index` (`continue_as_new_recommended`),\n KEY `workflow_run_summaries_history_budget_pressure_index` (`history_budget_pressure`),\n KEY `wfrs_prom_metrics_series_idx` (`namespace`,`queue`,`workflow_type`),\n CONSTRAINT `dw_json_text_accf32ee2c1a832ab845` CHECK (json_valid(`visibility_labels`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_timeline_entries", + "CREATE TABLE `workflow_run_timeline_entries` (\n `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `history_event_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `sequence` int unsigned NOT NULL,\n `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `kind` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `entry_kind` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'point',\n `source_kind` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `source_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `summary` text COLLATE utf8mb4_unicode_ci,\n `recorded_at` timestamp(6) NULL DEFAULT NULL,\n `command_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `command_sequence` int unsigned DEFAULT NULL,\n `task_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `activity_execution_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `timer_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `failure_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_run_timeline_run_event_unique` (`workflow_run_id`,`history_event_id`),\n KEY `workflow_run_timeline_run_sequence_index` (`workflow_run_id`,`sequence`),\n KEY `workflow_run_timeline_instance_kind_recorded_index` (`workflow_instance_id`,`kind`,`recorded_at`),\n KEY `workflow_run_timeline_entries_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_run_timeline_entries_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_run_timeline_entries_history_event_id_index` (`history_event_id`),\n KEY `workflow_run_timeline_entries_sequence_index` (`sequence`),\n KEY `workflow_run_timeline_entries_type_index` (`type`),\n KEY `workflow_run_timeline_entries_kind_index` (`kind`),\n KEY `workflow_run_timeline_entries_source_kind_index` (`source_kind`),\n KEY `workflow_run_timeline_entries_source_id_index` (`source_id`),\n KEY `workflow_run_timeline_entries_recorded_at_index` (`recorded_at`),\n KEY `workflow_run_timeline_entries_command_id_index` (`command_id`),\n KEY `workflow_run_timeline_entries_command_sequence_index` (`command_sequence`),\n KEY `workflow_run_timeline_entries_task_id_index` (`task_id`),\n KEY `workflow_run_timeline_entries_activity_execution_id_index` (`activity_execution_id`),\n KEY `workflow_run_timeline_entries_timer_id_index` (`timer_id`),\n KEY `workflow_run_timeline_entries_failure_id_index` (`failure_id`),\n CONSTRAINT `dw_json_text_4a34bf0686f5464d6b56` CHECK (json_valid(`payload`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_timer_entries", + "CREATE TABLE `workflow_run_timer_entries` (\n `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `timer_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `schema_version` smallint unsigned NOT NULL DEFAULT '1',\n `position` int unsigned NOT NULL,\n `sequence` int unsigned DEFAULT NULL,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `source_status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `delay_seconds` int DEFAULT NULL,\n `fire_at` timestamp(6) NULL DEFAULT NULL,\n `fired_at` timestamp(6) NULL DEFAULT NULL,\n `cancelled_at` timestamp(6) NULL DEFAULT NULL,\n `timer_kind` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `condition_wait_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `condition_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `condition_definition_fingerprint` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `history_authority` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `history_unsupported_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_run_timer_entries_run_timer_unique` (`workflow_run_id`,`timer_id`),\n KEY `workflow_run_timer_entries_run_status_position_index` (`workflow_run_id`,`status`,`position`),\n KEY `workflow_run_timer_entries_instance_kind_status_index` (`workflow_instance_id`,`timer_kind`,`status`),\n KEY `workflow_run_timer_entries_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_run_timer_entries_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_run_timer_entries_sequence_index` (`sequence`),\n KEY `workflow_run_timer_entries_status_index` (`status`),\n KEY `workflow_run_timer_entries_source_status_index` (`source_status`),\n KEY `workflow_run_timer_entries_timer_kind_index` (`timer_kind`),\n KEY `workflow_run_timer_entries_condition_wait_id_index` (`condition_wait_id`),\n KEY `workflow_run_timer_entries_condition_key_index` (`condition_key`),\n KEY `workflow_run_timer_entries_history_authority_index` (`history_authority`),\n CONSTRAINT `dw_json_text_cb1a9145e9dc22308d3d` CHECK (json_valid(`payload`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_timers", + "CREATE TABLE `workflow_run_timers` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `sequence` int unsigned NOT NULL,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `delay_seconds` bigint unsigned NOT NULL,\n `fire_at` timestamp(6) NOT NULL,\n `fired_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_run_timers_workflow_run_id_sequence_unique` (`workflow_run_id`,`sequence`),\n KEY `workflow_run_timers_status_fire_at_index` (`status`,`fire_at`),\n KEY `workflow_run_timers_workflow_run_id_index` (`workflow_run_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_run_waits", + "CREATE TABLE `workflow_run_waits` (\n `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `wait_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `position` int unsigned NOT NULL,\n `kind` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `sequence` int unsigned DEFAULT NULL,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `source_status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `summary` text COLLATE utf8mb4_unicode_ci,\n `opened_at` timestamp(6) NULL DEFAULT NULL,\n `deadline_at` timestamp(6) NULL DEFAULT NULL,\n `resolved_at` timestamp(6) NULL DEFAULT NULL,\n `target_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `target_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `task_backed` tinyint(1) NOT NULL DEFAULT '0',\n `external_only` tinyint(1) NOT NULL DEFAULT '0',\n `resume_source_kind` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resume_source_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `task_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `task_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `task_status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `command_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `command_sequence` int unsigned DEFAULT NULL,\n `command_status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `command_outcome` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `history_authority` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `history_unsupported_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_run_waits_run_wait_unique` (`workflow_run_id`,`wait_id`),\n KEY `workflow_run_waits_run_status_position_index` (`workflow_run_id`,`status`,`position`),\n KEY `workflow_run_waits_instance_kind_status_index` (`workflow_instance_id`,`kind`,`status`),\n KEY `workflow_run_waits_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_run_waits_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_run_waits_kind_index` (`kind`),\n KEY `workflow_run_waits_sequence_index` (`sequence`),\n KEY `workflow_run_waits_status_index` (`status`),\n KEY `workflow_run_waits_source_status_index` (`source_status`),\n KEY `workflow_run_waits_target_name_index` (`target_name`),\n KEY `workflow_run_waits_task_backed_index` (`task_backed`),\n KEY `workflow_run_waits_resume_source_kind_index` (`resume_source_kind`),\n KEY `workflow_run_waits_resume_source_id_index` (`resume_source_id`),\n KEY `workflow_run_waits_task_id_index` (`task_id`),\n KEY `workflow_run_waits_command_id_index` (`command_id`),\n KEY `workflow_run_waits_history_authority_index` (`history_authority`),\n CONSTRAINT `dw_json_text_e331c14bcddf551ccfdd` CHECK (json_valid(`payload`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_runs", + "CREATE TABLE `workflow_runs` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `run_number` int unsigned NOT NULL,\n `workflow_class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `business_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `visibility_labels` longtext COLLATE utf8mb4_bin,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `closed_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `compatibility` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload_codec` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `arguments` longtext COLLATE utf8mb4_unicode_ci,\n `output` longtext COLLATE utf8mb4_unicode_ci,\n `output_payload_codec` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `connection` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `queue` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `priority` tinyint unsigned NOT NULL DEFAULT '5',\n `fairness_key` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `fairness_weight` smallint unsigned NOT NULL DEFAULT '1',\n `sticky_worker_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `sticky_until` timestamp(6) NULL DEFAULT NULL,\n `last_history_sequence` int unsigned NOT NULL DEFAULT '0',\n `last_command_sequence` int unsigned NOT NULL DEFAULT '0',\n `message_cursor_position` int unsigned NOT NULL DEFAULT '0',\n `run_timeout_seconds` int unsigned DEFAULT NULL,\n `execution_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `run_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `archived_at` timestamp(6) NULL DEFAULT NULL,\n `archive_command_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `archive_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `last_progress_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `import_source` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `import_id` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `import_dedupe_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `import_contract_version` smallint unsigned DEFAULT NULL,\n `imported_at` timestamp(6) NULL DEFAULT NULL,\n `cancellation_request_command_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `cancellation_requested_at` timestamp(6) NULL DEFAULT NULL,\n `cancellation_deadline_at` timestamp(6) NULL DEFAULT NULL,\n `cancellation_delivery_sequence` int unsigned DEFAULT NULL,\n `cancellation_delivered_at` timestamp(6) NULL DEFAULT NULL,\n `details_pruned_at` timestamp(6) NULL DEFAULT NULL,\n `cancellation_scope_recovery_until` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_runs_workflow_instance_id_run_number_unique` (`workflow_instance_id`,`run_number`),\n KEY `workflow_runs_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_runs_namespace_index` (`namespace`),\n KEY `workflow_runs_business_key_index` (`business_key`),\n KEY `workflow_runs_sticky_worker_id_index` (`sticky_worker_id`),\n KEY `workflow_runs_sticky_until_index` (`sticky_until`),\n KEY `workflow_runs_archived_at_index` (`archived_at`),\n KEY `workflow_runs_archive_command_id_index` (`archive_command_id`),\n KEY `workflow_runs_import_source_index` (`import_source`),\n KEY `workflow_runs_import_id_index` (`import_id`),\n KEY `workflow_runs_import_dedupe_key_index` (`import_dedupe_key`),\n KEY `workflow_runs_imported_at_index` (`imported_at`),\n KEY `workflow_runs_prom_metrics_queue_idx` (`namespace`,`queue`),\n KEY `workflow_runs_namespace_status_quota_idx` (`namespace`,`status`),\n KEY `workflow_runs_cancellation_request_command_id_index` (`cancellation_request_command_id`),\n CONSTRAINT `dw_json_text_0cabe9701a2ae7cb549e` CHECK (json_valid(`visibility_labels`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_schedule_history_events", + "CREATE TABLE `workflow_schedule_history_events` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_schedule_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `schedule_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `sequence` int unsigned NOT NULL,\n `event_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `payload` longtext COLLATE utf8mb4_bin,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `recorded_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `occurrence_at_utc` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_schedule_history_schedule_sequence_unique` (`workflow_schedule_id`,`sequence`),\n KEY `wf_schedule_history_namespace_schedule_idx` (`namespace`,`schedule_id`),\n KEY `wf_schedule_history_event_recorded_idx` (`event_type`,`recorded_at`),\n KEY `wf_schedule_history_workflow_schedule_idx` (`workflow_schedule_id`),\n KEY `wf_schedule_history_schedule_idx` (`schedule_id`),\n KEY `wf_schedule_history_namespace_idx` (`namespace`),\n KEY `wf_schedule_history_instance_idx` (`workflow_instance_id`),\n KEY `wf_schedule_history_run_idx` (`workflow_run_id`),\n KEY `wf_schedule_history_occurrence_idx` (`workflow_schedule_id`,`event_type`,`occurrence_at_utc`),\n CONSTRAINT `dw_json_text_5c5faf594e8d31ebe991` CHECK (json_valid(`payload`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_schedules", + "CREATE TABLE `workflow_schedules` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `schedule_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `spec` longtext COLLATE utf8mb4_bin,\n `action` longtext COLLATE utf8mb4_bin,\n `status` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',\n `overlap_policy` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'skip',\n `note` text COLLATE utf8mb4_unicode_ci,\n `memo` longtext COLLATE utf8mb4_bin,\n `search_attributes` longtext COLLATE utf8mb4_bin,\n `visibility_labels` longtext COLLATE utf8mb4_bin,\n `jitter_seconds` int unsigned NOT NULL DEFAULT '0',\n `max_runs` bigint unsigned DEFAULT NULL,\n `remaining_actions` bigint unsigned DEFAULT NULL,\n `fires_count` bigint unsigned NOT NULL DEFAULT '0',\n `failures_count` bigint unsigned NOT NULL DEFAULT '0',\n `recent_actions` longtext COLLATE utf8mb4_bin,\n `buffered_actions` longtext COLLATE utf8mb4_bin,\n `last_fired_at` timestamp(6) NULL DEFAULT NULL,\n `next_fire_at` timestamp(6) NULL DEFAULT NULL,\n `latest_workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `connection` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `queue` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `paused_at` timestamp(6) NULL DEFAULT NULL,\n `deleted_at` timestamp(6) NULL DEFAULT NULL,\n `last_skip_reason` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `last_skipped_at` timestamp(6) NULL DEFAULT NULL,\n `skipped_trigger_count` bigint unsigned NOT NULL DEFAULT '0',\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `dispatch_summary` text COLLATE utf8mb4_unicode_ci,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_schedules_namespace_schedule_id_unique` (`namespace`,`schedule_id`),\n KEY `workflow_schedules_status_next_fire_at_index` (`status`,`next_fire_at`),\n KEY `workflow_schedules_namespace_index` (`namespace`),\n KEY `workflow_schedules_latest_workflow_instance_id_index` (`latest_workflow_instance_id`),\n CONSTRAINT `dw_json_text_023daf97483a6925003e` CHECK (json_valid(`recent_actions`)),\n CONSTRAINT `dw_json_text_0779e5110faa8bb3a1ce` CHECK (json_valid(`action`)),\n CONSTRAINT `dw_json_text_127f3a5484eae46b4296` CHECK (json_valid(`memo`)),\n CONSTRAINT `dw_json_text_260b502951aabe6967a2` CHECK (json_valid(`visibility_labels`)),\n CONSTRAINT `dw_json_text_348ceaaa72578f94b30d` CHECK (json_valid(`search_attributes`)),\n CONSTRAINT `dw_json_text_d7aa273e112ccdb9bce4` CHECK (json_valid(`spec`)),\n CONSTRAINT `dw_json_text_fcbf8efdd61dbed85da4` CHECK (json_valid(`buffered_actions`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_search_attributes", + "CREATE TABLE `workflow_search_attributes` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Attribute name (e.g., \"customer_id\", \"priority\", \"region\")',\n `type` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Type: string, keyword, int, float, bool, datetime',\n `value_string` text COLLATE utf8mb4_unicode_ci COMMENT 'For type=string (max 2048 chars enforced at app level)',\n `value_keyword` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'For type=keyword (exact match, indexed)',\n `value_keyword_list` longtext COLLATE utf8mb4_bin COMMENT 'For type=keyword_list (ordered exact-match values)',\n `value_int` bigint DEFAULT NULL COMMENT 'For type=int',\n `value_float` double DEFAULT NULL COMMENT 'For type=float',\n `value_bool` tinyint(1) DEFAULT NULL COMMENT 'For type=bool',\n `value_datetime` timestamp(6) NULL DEFAULT NULL COMMENT 'For type=datetime (microsecond precision)',\n `upserted_at_sequence` int unsigned NOT NULL COMMENT 'History sequence when this attribute was last upserted',\n `inherited_from_parent` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if inherited via continue-as-new',\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_search_attrs_run_key_unique` (`workflow_run_id`,`key`),\n KEY `workflow_search_attrs_instance_key_type` (`workflow_instance_id`,`key`,`type`),\n KEY `workflow_search_attrs_key_keyword` (`key`,`value_keyword`),\n KEY `workflow_search_attrs_key_int` (`key`,`value_int`),\n KEY `workflow_search_attrs_key_float` (`key`,`value_float`),\n KEY `workflow_search_attrs_key_bool` (`key`,`value_bool`),\n KEY `workflow_search_attrs_key_datetime` (`key`,`value_datetime`),\n KEY `workflow_search_attributes_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_search_attributes_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_search_attributes_value_keyword_index` (`value_keyword`),\n KEY `workflow_search_attributes_value_int_index` (`value_int`),\n KEY `workflow_search_attributes_value_float_index` (`value_float`),\n KEY `workflow_search_attributes_value_bool_index` (`value_bool`),\n KEY `workflow_search_attributes_value_datetime_index` (`value_datetime`),\n CONSTRAINT `workflow_search_attributes_workflow_run_id_foreign` FOREIGN KEY (`workflow_run_id`) REFERENCES `workflow_runs` (`id`) ON DELETE CASCADE,\n CONSTRAINT `dw_json_text_df0541f7f01fef92919f` CHECK (json_valid(`value_keyword_list`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_service_calls", + "CREATE TABLE `workflow_service_calls` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_service_endpoint_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_service_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_service_operation_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `endpoint_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `service_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `operation_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `caller_namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `caller_workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `caller_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `target_namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `linked_workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `linked_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `linked_workflow_update_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `status` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,\n `outcome` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `operation_mode` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,\n `resolved_binding_kind` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resolved_target_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload_codec` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `input_payload_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `output_payload_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `failure_payload_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `failure_message` text COLLATE utf8mb4_unicode_ci,\n `idempotency_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `deadline_policy` longtext COLLATE utf8mb4_bin,\n `idempotency_policy` longtext COLLATE utf8mb4_bin,\n `cancellation_policy` longtext COLLATE utf8mb4_bin,\n `retry_policy` longtext COLLATE utf8mb4_bin,\n `boundary_policy` longtext COLLATE utf8mb4_bin,\n `metadata` longtext COLLATE utf8mb4_bin,\n `outcome_category` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `outcome_reason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `outcome_message` text COLLATE utf8mb4_unicode_ci,\n `outcome_metadata` longtext COLLATE utf8mb4_bin,\n `policy_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `retry_after_seconds` int unsigned DEFAULT NULL,\n `caller_principal_subject` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `caller_principal_method` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `caller_principal_roles` longtext COLLATE utf8mb4_bin,\n `caller_principal_tenant` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `caller_principal_claims` longtext COLLATE utf8mb4_bin,\n `accepted_at` timestamp(6) NULL DEFAULT NULL,\n `started_at` timestamp(6) NULL DEFAULT NULL,\n `completed_at` timestamp(6) NULL DEFAULT NULL,\n `failed_at` timestamp(6) NULL DEFAULT NULL,\n `cancelled_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `wf_service_calls_namespace_status_idx` (`namespace`,`status`),\n KEY `wf_service_calls_caller_status_idx` (`caller_namespace`,`status`),\n KEY `wf_service_calls_target_status_idx` (`target_namespace`,`status`),\n KEY `wf_service_calls_namespace_outcome_idx` (`namespace`,`outcome`),\n KEY `wf_service_calls_caller_outcome_idx` (`caller_namespace`,`outcome`),\n KEY `wf_service_calls_target_outcome_idx` (`target_namespace`,`outcome`),\n KEY `wf_service_calls_endpoint_idx` (`workflow_service_endpoint_id`),\n KEY `wf_service_calls_service_idx` (`workflow_service_id`),\n KEY `wf_service_calls_operation_idx` (`workflow_service_operation_id`),\n KEY `wf_service_calls_namespace_idx` (`namespace`),\n KEY `wf_service_calls_caller_namespace_idx` (`caller_namespace`),\n KEY `wf_service_calls_caller_instance_idx` (`caller_workflow_instance_id`),\n KEY `wf_service_calls_caller_run_idx` (`caller_workflow_run_id`),\n KEY `wf_service_calls_target_namespace_idx` (`target_namespace`),\n KEY `wf_service_calls_linked_instance_idx` (`linked_workflow_instance_id`),\n KEY `wf_service_calls_linked_run_idx` (`linked_workflow_run_id`),\n KEY `wf_service_calls_linked_update_idx` (`linked_workflow_update_id`),\n KEY `wf_service_calls_status_idx` (`status`),\n KEY `wf_service_calls_outcome_idx` (`outcome`),\n KEY `wf_service_calls_mode_idx` (`operation_mode`),\n KEY `wf_service_calls_binding_kind_idx` (`resolved_binding_kind`),\n KEY `wf_service_calls_idempotency_idx` (`idempotency_key`),\n KEY `wf_service_calls_outcome_category_idx` (`outcome_category`),\n KEY `wf_service_calls_policy_idx` (`policy_name`),\n KEY `wf_service_calls_principal_subject_idx` (`caller_principal_subject`),\n KEY `wf_service_calls_accepted_at_idx` (`accepted_at`),\n CONSTRAINT `dw_json_text_4a6c5e40752d4ed0bdb4` CHECK (json_valid(`metadata`)),\n CONSTRAINT `dw_json_text_5a480bd9165f2eb68e43` CHECK (json_valid(`caller_principal_roles`)),\n CONSTRAINT `dw_json_text_718533c1e82804b31504` CHECK (json_valid(`deadline_policy`)),\n CONSTRAINT `dw_json_text_77a64a96c9d03d965701` CHECK (json_valid(`cancellation_policy`)),\n CONSTRAINT `dw_json_text_89af2bddb6216607276e` CHECK (json_valid(`idempotency_policy`)),\n CONSTRAINT `dw_json_text_89f01ea9712aa07575bf` CHECK (json_valid(`retry_policy`)),\n CONSTRAINT `dw_json_text_b4ffcdd589152c314969` CHECK (json_valid(`outcome_metadata`)),\n CONSTRAINT `dw_json_text_cb4fc45f46fe05d68f99` CHECK (json_valid(`caller_principal_claims`)),\n CONSTRAINT `dw_json_text_e06e9f587b4efc8ce3e9` CHECK (json_valid(`boundary_policy`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_service_endpoints", + "CREATE TABLE `workflow_service_endpoints` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `endpoint_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` text COLLATE utf8mb4_unicode_ci,\n `boundary_policy` longtext COLLATE utf8mb4_bin,\n `metadata` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_service_endpoints_namespace_name_unique` (`namespace`,`endpoint_name`),\n KEY `wf_service_endpoints_namespace_idx` (`namespace`),\n KEY `wf_service_endpoints_name_idx` (`endpoint_name`),\n CONSTRAINT `dw_json_text_3c3c6c7139ec6ffc9fd5` CHECK (json_valid(`metadata`)),\n CONSTRAINT `dw_json_text_6e65cde38938c5bf2752` CHECK (json_valid(`boundary_policy`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_service_operations", + "CREATE TABLE `workflow_service_operations` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_service_endpoint_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_service_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `operation_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` text COLLATE utf8mb4_unicode_ci,\n `operation_mode` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,\n `handler_binding_kind` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `handler_target_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `handler_binding` longtext COLLATE utf8mb4_bin,\n `deadline_policy` longtext COLLATE utf8mb4_bin,\n `idempotency_policy` longtext COLLATE utf8mb4_bin,\n `cancellation_policy` longtext COLLATE utf8mb4_bin,\n `retry_policy` longtext COLLATE utf8mb4_bin,\n `boundary_policy` longtext COLLATE utf8mb4_bin,\n `metadata` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_service_ops_namespace_service_name_unique` (`namespace`,`workflow_service_id`,`operation_name`),\n KEY `wf_service_ops_namespace_name_idx` (`namespace`,`operation_name`),\n KEY `wf_service_ops_endpoint_idx` (`workflow_service_endpoint_id`),\n KEY `wf_service_ops_service_idx` (`workflow_service_id`),\n KEY `wf_service_ops_namespace_idx` (`namespace`),\n KEY `wf_service_ops_name_idx` (`operation_name`),\n KEY `wf_service_ops_mode_idx` (`operation_mode`),\n KEY `wf_service_ops_binding_kind_idx` (`handler_binding_kind`),\n CONSTRAINT `dw_json_text_05dd84f339d72c2ea677` CHECK (json_valid(`boundary_policy`)),\n CONSTRAINT `dw_json_text_13e161b371e6bd18c390` CHECK (json_valid(`cancellation_policy`)),\n CONSTRAINT `dw_json_text_2409229a6279aa76321a` CHECK (json_valid(`retry_policy`)),\n CONSTRAINT `dw_json_text_818561935c015a8f258c` CHECK (json_valid(`metadata`)),\n CONSTRAINT `dw_json_text_aaf235f8970ff7618e0c` CHECK (json_valid(`deadline_policy`)),\n CONSTRAINT `dw_json_text_e844533982a5ba5f974a` CHECK (json_valid(`handler_binding`)),\n CONSTRAINT `dw_json_text_e9b84c12c63f3f05d4f8` CHECK (json_valid(`idempotency_policy`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_services", + "CREATE TABLE `workflow_services` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_service_endpoint_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `service_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` text COLLATE utf8mb4_unicode_ci,\n `boundary_policy` longtext COLLATE utf8mb4_bin,\n `metadata` longtext COLLATE utf8mb4_bin,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `wf_services_namespace_endpoint_name_unique` (`namespace`,`workflow_service_endpoint_id`,`service_name`),\n KEY `wf_services_namespace_name_idx` (`namespace`,`service_name`),\n KEY `wf_services_endpoint_idx` (`workflow_service_endpoint_id`),\n KEY `wf_services_namespace_idx` (`namespace`),\n KEY `wf_services_name_idx` (`service_name`),\n CONSTRAINT `dw_json_text_1af5bae7acfe0b9d3f11` CHECK (json_valid(`boundary_policy`)),\n CONSTRAINT `dw_json_text_4e612803d0ef9c0cfcaa` CHECK (json_valid(`metadata`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_signal_records", + "CREATE TABLE `workflow_signal_records` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_command_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `target_scope` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'instance',\n `requested_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resolved_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `signal_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `signal_wait_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `outcome` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `command_sequence` int unsigned DEFAULT NULL,\n `workflow_sequence` int unsigned DEFAULT NULL,\n `payload_codec` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `arguments` longtext COLLATE utf8mb4_unicode_ci,\n `validation_errors` longtext COLLATE utf8mb4_bin,\n `rejection_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `received_at` timestamp(6) NULL DEFAULT NULL,\n `applied_at` timestamp(6) NULL DEFAULT NULL,\n `rejected_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_signal_records_workflow_command_id_unique` (`workflow_command_id`),\n KEY `workflow_signal_records_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_signal_records_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_signal_records_requested_workflow_run_id_index` (`requested_workflow_run_id`),\n KEY `workflow_signal_records_resolved_workflow_run_id_index` (`resolved_workflow_run_id`),\n KEY `workflow_signal_records_signal_name_index` (`signal_name`),\n KEY `workflow_signal_records_signal_wait_id_index` (`signal_wait_id`),\n KEY `workflow_signal_records_status_index` (`status`),\n KEY `workflow_signal_records_outcome_index` (`outcome`),\n KEY `workflow_signal_records_command_sequence_index` (`command_sequence`),\n KEY `workflow_signal_records_workflow_sequence_index` (`workflow_sequence`),\n CONSTRAINT `dw_json_text_87990e1e6c171fd7edb3` CHECK (json_valid(`validation_errors`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_task_poll_cursors", + "CREATE TABLE `workflow_task_poll_cursors` (\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `task_queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `next_task_kind` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`namespace`,`task_queue`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_tasks", + "CREATE TABLE `workflow_tasks` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `task_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `compatibility` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `payload` longtext COLLATE utf8mb4_bin,\n `connection` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `queue` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `priority` tinyint unsigned NOT NULL DEFAULT '5',\n `fairness_key` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `fairness_weight` smallint unsigned NOT NULL DEFAULT '1',\n `sticky_worker_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `sticky_until` timestamp(6) NULL DEFAULT NULL,\n `sticky_replay_mode` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `sticky_claimed_at` timestamp(6) NULL DEFAULT NULL,\n `available_at` timestamp(6) NULL DEFAULT NULL,\n `leased_at` timestamp(6) NULL DEFAULT NULL,\n `lease_owner` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `lease_expires_at` timestamp(6) NULL DEFAULT NULL,\n `attempt_count` int unsigned NOT NULL DEFAULT '0',\n `last_dispatch_attempt_at` timestamp(6) NULL DEFAULT NULL,\n `last_dispatched_at` timestamp(6) NULL DEFAULT NULL,\n `last_dispatch_error` text COLLATE utf8mb4_unicode_ci,\n `last_claim_failed_at` timestamp(6) NULL DEFAULT NULL,\n `last_claim_error` text COLLATE utf8mb4_unicode_ci,\n `repair_count` int unsigned NOT NULL DEFAULT '0',\n `repair_available_at` timestamp(6) NULL DEFAULT NULL,\n `last_error` text COLLATE utf8mb4_unicode_ci,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n `ready_origin_at` datetime(6) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `workflow_tasks_status_available_at_index` (`status`,`available_at`),\n KEY `workflow_tasks_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_tasks_namespace_index` (`namespace`),\n KEY `workflow_tasks_sticky_worker_id_index` (`sticky_worker_id`),\n KEY `workflow_tasks_sticky_until_index` (`sticky_until`),\n KEY `workflow_tasks_sticky_replay_mode_index` (`sticky_replay_mode`),\n KEY `workflow_tasks_sticky_claimed_at_index` (`sticky_claimed_at`),\n KEY `workflow_tasks_dispatch_order_index` (`queue`,`status`,`priority`,`available_at`),\n KEY `workflow_tasks_namespace_queue_status_idx` (`namespace`,`queue`,`status`),\n KEY `workflow_tasks_fairness_class_index` (`queue`,`status`,`fairness_key`),\n KEY `workflow_tasks_prom_metrics_queue_idx` (`namespace`,`queue`),\n KEY `dw_workflow_tasks_poll` (`namespace`(64),`queue`(64),`task_type`(16),`status`(16),`available_at`),\n KEY `dw_workflow_tasks_scoped_dispatch` (`namespace`,`queue`,`task_type`(16),`status`(16),`priority`,`available_at`,`id`),\n CONSTRAINT `dw_json_text_edce43b6b7b815300bd1` CHECK (json_valid(`payload`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_update_validation_tasks", + "CREATE TABLE `workflow_update_validation_tasks` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `idempotency_key` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `task_queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `compatibility` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_definition_fingerprint` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `update_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `request_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `input_hash` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `payload_codec` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `arguments` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `command_context` longtext COLLATE utf8mb4_bin,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `attempt_count` int unsigned NOT NULL DEFAULT '0',\n `lease_owner` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `lease_expires_at` timestamp(6) NULL DEFAULT NULL,\n `rejection_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `rejection_message` text COLLATE utf8mb4_unicode_ci,\n `failure_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `validation_errors` longtext COLLATE utf8mb4_bin,\n `approved_at` timestamp(6) NULL DEFAULT NULL,\n `rejected_at` timestamp(6) NULL DEFAULT NULL,\n `failed_at` timestamp(6) NULL DEFAULT NULL,\n `timed_out_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_update_validation_tasks_idempotency_key_unique` (`idempotency_key`),\n KEY `workflow_update_validation_poll_index` (`namespace`,`task_queue`,`status`,`created_at`),\n KEY `workflow_update_validation_tasks_namespace_index` (`namespace`),\n KEY `workflow_update_validation_tasks_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_update_validation_tasks_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_update_validation_tasks_workflow_type_index` (`workflow_type`),\n KEY `workflow_update_validation_tasks_task_queue_index` (`task_queue`),\n KEY `workflow_update_validation_tasks_compatibility_index` (`compatibility`),\n KEY `workflow_update_validation_tasks_update_name_index` (`update_name`),\n KEY `workflow_update_validation_tasks_status_index` (`status`),\n KEY `workflow_update_validation_tasks_lease_owner_index` (`lease_owner`),\n KEY `workflow_update_validation_tasks_lease_expires_at_index` (`lease_expires_at`),\n CONSTRAINT `dw_json_text_8648c83f3febc7faec99` CHECK (json_valid(`command_context`)),\n CONSTRAINT `dw_json_text_fc8e8804602cda328168` CHECK (json_valid(`validation_errors`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_updates", + "CREATE TABLE `workflow_updates` (\n `id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_command_id` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL,\n `workflow_instance_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `target_scope` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'instance',\n `requested_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resolved_workflow_run_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `update_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `outcome` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `command_sequence` int unsigned DEFAULT NULL,\n `workflow_sequence` int unsigned DEFAULT NULL,\n `payload_codec` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `arguments` longtext COLLATE utf8mb4_unicode_ci,\n `result` longtext COLLATE utf8mb4_unicode_ci,\n `validation_errors` longtext COLLATE utf8mb4_bin,\n `rejection_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `failure_id` varchar(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `failure_message` text COLLATE utf8mb4_unicode_ci,\n `accepted_at` timestamp(6) NULL DEFAULT NULL,\n `applied_at` timestamp(6) NULL DEFAULT NULL,\n `rejected_at` timestamp(6) NULL DEFAULT NULL,\n `closed_at` timestamp(6) NULL DEFAULT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_updates_workflow_command_id_unique` (`workflow_command_id`),\n KEY `workflow_updates_workflow_instance_id_index` (`workflow_instance_id`),\n KEY `workflow_updates_workflow_run_id_index` (`workflow_run_id`),\n KEY `workflow_updates_requested_workflow_run_id_index` (`requested_workflow_run_id`),\n KEY `workflow_updates_resolved_workflow_run_id_index` (`resolved_workflow_run_id`),\n KEY `workflow_updates_update_name_index` (`update_name`),\n KEY `workflow_updates_status_index` (`status`),\n KEY `workflow_updates_outcome_index` (`outcome`),\n KEY `workflow_updates_command_sequence_index` (`command_sequence`),\n KEY `workflow_updates_workflow_sequence_index` (`workflow_sequence`),\n KEY `workflow_updates_failure_id_index` (`failure_id`),\n CONSTRAINT `dw_json_text_efe19529950144852322` CHECK (json_valid(`validation_errors`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_worker_build_id_rollouts", + "CREATE TABLE `workflow_worker_build_id_rollouts` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `task_queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `build_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',\n `drain_intent` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',\n `drained_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `promoted_at` timestamp NULL DEFAULT NULL,\n `rolled_back_at` timestamp NULL DEFAULT NULL,\n `required_compatibility` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `recorded_fingerprint` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `compatibility_policy` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `workflow_types` longtext COLLATE utf8mb4_bin,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_build_id_rollouts_scope_unique` (`namespace`,`task_queue`,`build_id`),\n CONSTRAINT `dw_json_text_19de9b23ee283257b769` CHECK (json_valid(`workflow_types`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_worker_compatibility_heartbeats", + "CREATE TABLE `workflow_worker_compatibility_heartbeats` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `worker_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `scope_key` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `host` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `process_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `connection` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `queue` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `supported` longtext COLLATE utf8mb4_bin NOT NULL,\n `recorded_at` datetime(6) NOT NULL,\n `expires_at` datetime(6) NOT NULL,\n `created_at` timestamp(6) NULL DEFAULT NULL,\n `updated_at` timestamp(6) NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_worker_compatibility_heartbeats_scope_unique` (`worker_id`,`scope_key`),\n KEY `workflow_worker_compatibility_heartbeats_namespace_index` (`namespace`),\n KEY `workflow_worker_compatibility_heartbeats_connection_index` (`connection`),\n KEY `workflow_worker_compatibility_heartbeats_queue_index` (`queue`),\n KEY `workflow_worker_compatibility_heartbeats_expires_at_index` (`expires_at`),\n CONSTRAINT `dw_json_text_c9c8573bb83f23ce864d` CHECK (json_valid(`supported`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_worker_registrations", + "CREATE TABLE `workflow_worker_registrations` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `worker_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `task_queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `runtime` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,\n `sdk_version` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `build_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `supported_workflow_types` longtext COLLATE utf8mb4_bin,\n `workflow_definition_fingerprints` longtext COLLATE utf8mb4_bin,\n `workflow_command_contracts` longtext COLLATE utf8mb4_bin,\n `supported_activity_types` longtext COLLATE utf8mb4_bin,\n `capabilities` longtext COLLATE utf8mb4_bin,\n `capability_manifest` longtext COLLATE utf8mb4_bin,\n `max_concurrent_workflow_tasks` int unsigned NOT NULL DEFAULT '100',\n `max_concurrent_activity_tasks` int unsigned NOT NULL DEFAULT '100',\n `max_concurrent_worker_sessions` int unsigned NOT NULL DEFAULT '10',\n `available_workflow_slots` int unsigned DEFAULT NULL,\n `available_activity_slots` int unsigned DEFAULT NULL,\n `available_session_slots` int unsigned DEFAULT NULL,\n `process_metrics` longtext COLLATE utf8mb4_bin,\n `heartbeat_interval_seconds` int unsigned DEFAULT NULL,\n `last_heartbeat_at` timestamp NULL DEFAULT NULL,\n `status` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_worker_registrations_worker_id_namespace_unique` (`worker_id`,`namespace`),\n KEY `workflow_worker_registrations_namespace_task_queue_status_index` (`namespace`,`task_queue`,`status`),\n CONSTRAINT `dw_json_text_34d29bf4c212ababa706` CHECK (json_valid(`process_metrics`)),\n CONSTRAINT `dw_json_text_4d23abbe7d6f10d67024` CHECK (json_valid(`supported_activity_types`)),\n CONSTRAINT `dw_json_text_4f49aa63cb080bc75d50` CHECK (json_valid(`workflow_definition_fingerprints`)),\n CONSTRAINT `dw_json_text_5db648194e26be45f445` CHECK (json_valid(`capabilities`)),\n CONSTRAINT `dw_json_text_5ff38312fcf7d855445d` CHECK (json_valid(`workflow_command_contracts`)),\n CONSTRAINT `dw_json_text_9e5445d614888bb3661c` CHECK (json_valid(`supported_workflow_types`)),\n CONSTRAINT `dw_json_text_d1357dfe1fe52c7b2691` CHECK (json_valid(`capability_manifest`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ], + [ + "workflow_worker_sessions", + "CREATE TABLE `workflow_worker_sessions` (\n `id` bigint unsigned NOT NULL AUTO_INCREMENT,\n `namespace` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,\n `session_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `connection` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `queue` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `requirements` longtext COLLATE utf8mb4_bin,\n `status` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',\n `lease_owner` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `lease_expires_at` timestamp NULL DEFAULT NULL,\n `ttl_expires_at` timestamp NULL DEFAULT NULL,\n `closed_at` timestamp NULL DEFAULT NULL,\n `failure_reason` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `lease_seconds` int unsigned NOT NULL DEFAULT '120',\n `ttl_seconds` int unsigned NOT NULL DEFAULT '1800',\n `max_concurrent_activities` int unsigned NOT NULL DEFAULT '1',\n `create_if_missing` tinyint(1) NOT NULL DEFAULT '1',\n `allow_reacquire_after_failure` tinyint(1) NOT NULL DEFAULT '1',\n `last_heartbeat_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `workflow_worker_sessions_namespace_session_id_unique` (`namespace`,`session_id`),\n KEY `workflow_worker_sessions_namespace_status_index` (`namespace`,`status`),\n KEY `workflow_worker_sessions_namespace_lease_owner_status_index` (`namespace`,`lease_owner`,`status`),\n KEY `workflow_worker_sessions_namespace_queue_status_index` (`namespace`,`queue`,`status`),\n CONSTRAINT `dw_json_text_177d4c6e72d9b9fdebda` CHECK (json_valid(`requirements`))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" + ] +] diff --git a/rust/migrations/mysql/0017_external_storage_bindings.sql b/rust/migrations/mysql/0017_external_storage_bindings.sql new file mode 100644 index 000000000..edab43a8a --- /dev/null +++ b/rust/migrations/mysql/0017_external_storage_bindings.sql @@ -0,0 +1,3 @@ +-- Original object authority survives namespace write-policy changes. +ALTER TABLE runtime_external_payloads ADD COLUMN storage_binding TEXT NULL; +ALTER TABLE workflow_namespaces ADD COLUMN external_payload_storage_generation BIGINT NOT NULL DEFAULT 0; diff --git a/rust/migrations/postgres/0015_checksum.txt b/rust/migrations/postgres/0015_checksum.txt new file mode 100644 index 000000000..cf8d19e8c --- /dev/null +++ b/rust/migrations/postgres/0015_checksum.txt @@ -0,0 +1 @@ +758fe38121935edc3851855dd41d2be8d766632388dd78e96f56442424488fbe3d320686c70ebfed5d78ca70117ccc07 diff --git a/rust/migrations/postgres/0016_catalog.json b/rust/migrations/postgres/0016_catalog.json new file mode 100644 index 000000000..ac6a74968 --- /dev/null +++ b/rust/migrations/postgres/0016_catalog.json @@ -0,0 +1,19436 @@ +[ + [ + "column", + "_sqlx_migrations.1", + { + "name": "version", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "_sqlx_migrations.2", + { + "name": "description", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "_sqlx_migrations.3", + { + "name": "installed_on", + "type": "timestamp with time zone", + "default": "now()", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "_sqlx_migrations.4", + { + "name": "success", + "type": "boolean", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "_sqlx_migrations.5", + { + "name": "checksum", + "type": "bytea", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "_sqlx_migrations.6", + { + "name": "execution_time", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_attempts.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_attempts.10", + { + "name": "lease_expires_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_attempts.11", + { + "name": "closed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_attempts.12", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_attempts.13", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_attempts.14", + { + "name": "worker_attempt_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_attempts.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_attempts.3", + { + "name": "activity_execution_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_attempts.4", + { + "name": "workflow_task_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_attempts.5", + { + "name": "attempt_number", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_attempts.6", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_attempts.7", + { + "name": "lease_owner", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_attempts.8", + { + "name": "started_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_attempts.9", + { + "name": "last_heartbeat_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.10", + { + "name": "exception", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.11", + { + "name": "connection", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.12", + { + "name": "queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.13", + { + "name": "attempt_count", + "type": "integer", + "default": "1", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.14", + { + "name": "current_attempt_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.15", + { + "name": "retry_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.16", + { + "name": "parallel_group_path", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.17", + { + "name": "activity_options", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.18", + { + "name": "schedule_deadline_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.19", + { + "name": "close_deadline_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.20", + { + "name": "schedule_to_close_deadline_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.21", + { + "name": "heartbeat_deadline_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.22", + { + "name": "started_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.23", + { + "name": "closed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.24", + { + "name": "last_heartbeat_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.25", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.26", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.3", + { + "name": "sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "activity_executions.4", + { + "name": "activity_class", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.5", + { + "name": "activity_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.6", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.7", + { + "name": "payload_codec", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.8", + { + "name": "arguments", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "activity_executions.9", + { + "name": "result", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_command_intents.1", + { + "name": "command_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_command_intents.2", + { + "name": "namespace", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_command_intents.3", + { + "name": "intent_digest", + "type": "character varying(71)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_external_payload_deletions.1", + { + "name": "id", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_external_payload_deletions.2", + { + "name": "namespace", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_external_payload_deletions.3", + { + "name": "storage_uri", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_external_payload_deletions.4", + { + "name": "storage_uri_sha256", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_external_payload_deletions.5", + { + "name": "storage_policy", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_external_payload_deletions.6", + { + "name": "attempts", + "type": "bigint", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_external_payload_deletions.7", + { + "name": "failure_code", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_external_payload_deletions.8", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_external_payload_deletions.9", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_poll_receipts.1", + { + "name": "namespace", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_poll_receipts.2", + { + "name": "worker_id", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_poll_receipts.3", + { + "name": "kind", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_poll_receipts.4", + { + "name": "request_id", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_poll_receipts.5", + { + "name": "task_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_poll_receipts.6", + { + "name": "attempt", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_poll_receipts.7", + { + "name": "response", + "type": "jsonb", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_poll_receipts.8", + { + "name": "expires_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_query_cache.1", + { + "name": "key", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_query_cache.2", + { + "name": "value", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_query_cache.3", + { + "name": "expiration", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_run_command_contracts.1", + { + "name": "workflow_run_id", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_run_command_contracts.2", + { + "name": "namespace", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_run_command_contracts.3", + { + "name": "workflow_type", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_run_command_contracts.4", + { + "name": "contract", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_run_command_contracts.5", + { + "name": "worker_id", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_run_command_contracts.6", + { + "name": "workflow_task_id", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_run_command_contracts.7", + { + "name": "bound_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_server_schema.1", + { + "name": "engine", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_server_schema.2", + { + "name": "version", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_service_admission_counters.1", + { + "name": "cache_key", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_service_admission_counters.2", + { + "name": "amount", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_service_admission_counters.3", + { + "name": "expires_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_service_call_deadlines.1", + { + "name": "service_call_id", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_service_call_deadlines.2", + { + "name": "namespace", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_service_call_deadlines.3", + { + "name": "call_deadline_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_stream_reclaims.1", + { + "name": "stream_id", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_stream_reclaims.2", + { + "name": "namespace", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_stream_reclaims.3", + { + "name": "workflow_run_id", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_stream_reclaims.4", + { + "name": "reclaim_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_task_completions.1", + { + "name": "task_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_task_completions.2", + { + "name": "receipt", + "type": "jsonb", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_task_queue_pauses.1", + { + "name": "namespace", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_task_queue_pauses.2", + { + "name": "task_queue", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_task_queue_pauses.3", + { + "name": "reason", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_task_queue_pauses.4", + { + "name": "paused_by", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_task_queue_pauses.5", + { + "name": "paused_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_task_queue_pauses.6", + { + "name": "resumed_by", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_task_queue_pauses.7", + { + "name": "resumed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_worker_registration_incarnations.1", + { + "name": "token", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_worker_registration_incarnations.2", + { + "name": "namespace", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_worker_registration_incarnations.3", + { + "name": "worker_id", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_worker_registration_incarnations.4", + { + "name": "status", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_worker_registration_incarnations.5", + { + "name": "recovered_workflow_task_count", + "type": "bigint", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_worker_registration_incarnations.6", + { + "name": "finished_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_worker_registration_incarnations.7", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_worker_registration_incarnations.8", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "dw_worker_session_holders.1", + { + "name": "namespace", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_worker_session_holders.2", + { + "name": "session_id", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_worker_session_holders.3", + { + "name": "incarnation", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "dw_worker_session_holders.4", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "failed_jobs.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('failed_jobs_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "failed_jobs.2", + { + "name": "uuid", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "failed_jobs.3", + { + "name": "connection", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "failed_jobs.4", + { + "name": "queue", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "failed_jobs.5", + { + "name": "payload", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "failed_jobs.6", + { + "name": "exception", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "failed_jobs.7", + { + "name": "failed_at", + "type": "timestamp(0) without time zone", + "default": "CURRENT_TIMESTAMP", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "jobs.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('jobs_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "jobs.2", + { + "name": "queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "jobs.3", + { + "name": "payload", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "jobs.4", + { + "name": "attempts", + "type": "smallint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "jobs.5", + { + "name": "reserved_at", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "jobs.6", + { + "name": "available_at", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "jobs.7", + { + "name": "created_at", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "migrations.1", + { + "name": "id", + "type": "integer", + "default": "nextval('migrations_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "migrations.2", + { + "name": "migration", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "migrations.3", + { + "name": "batch", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_credentials.1", + { + "name": "id", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_credentials.10", + { + "name": "revoked_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_credentials.11", + { + "name": "rotated_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_credentials.12", + { + "name": "created_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_credentials.13", + { + "name": "updated_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_credentials.2", + { + "name": "name", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_credentials.3", + { + "name": "subject", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_credentials.4", + { + "name": "roles", + "type": "json", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_credentials.5", + { + "name": "tenant", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_credentials.6", + { + "name": "claims", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_credentials.7", + { + "name": "token_prefix", + "type": "character varying(16)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_credentials.8", + { + "name": "token_hash", + "type": "character(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_credentials.9", + { + "name": "expires_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_backup_hold.1", + { + "name": "id", + "type": "smallint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_backup_hold.2", + { + "name": "owner", + "type": "uuid", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_backup_hold.3", + { + "name": "acquired_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_backup_hold.4", + { + "name": "expires_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.1", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.10", + { + "name": "last_deleted_backing_objects", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.11", + { + "name": "last_shared_objects_preserved", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.12", + { + "name": "last_blocked_outcomes", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.13", + { + "name": "last_storage_driver_failures", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.14", + { + "name": "last_pass_status", + "type": "character varying(16)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.15", + { + "name": "last_completed_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.16", + { + "name": "last_storage_failure_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.17", + { + "name": "created_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.18", + { + "name": "updated_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.2", + { + "name": "passes_total", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.3", + { + "name": "deleted_references_total", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.4", + { + "name": "deleted_backing_objects_total", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.5", + { + "name": "shared_objects_preserved_total", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.6", + { + "name": "blocked_outcomes_total", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.7", + { + "name": "storage_driver_failures_total", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.8", + { + "name": "last_processed", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_cleanup_stats.9", + { + "name": "last_deleted_references", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payload_object_locks.1", + { + "name": "bucket", + "type": "smallint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.1", + { + "name": "id", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.10", + { + "name": "last_fetched_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.11", + { + "name": "created_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.12", + { + "name": "updated_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.13", + { + "name": "upload_status", + "type": "character varying(16)", + "default": "'ready'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.2", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.3", + { + "name": "storage_uri", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.4", + { + "name": "storage_uri_sha256", + "type": "character(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.5", + { + "name": "codec", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.6", + { + "name": "sha256", + "type": "character(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.7", + { + "name": "size_bytes", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.8", + { + "name": "retained_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.9", + { + "name": "expires_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_external_payloads.storage_binding", + { + "name": "storage_binding", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_payload_completion_budgets.1", + { + "name": "id", + "type": "character(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_payload_completion_budgets.2", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "runtime_payload_completion_budgets.3", + { + "name": "context", + "type": "json", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_payload_completion_budgets.4", + { + "name": "slots", + "type": "json", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_payload_completion_budgets.5", + { + "name": "objects", + "type": "json", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_payload_completion_budgets.6", + { + "name": "expires_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_payload_completion_budgets.7", + { + "name": "created_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "runtime_payload_completion_budgets.8", + { + "name": "updated_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "search_attribute_definitions.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('search_attribute_definitions_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "search_attribute_definitions.2", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "search_attribute_definitions.3", + { + "name": "name", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "search_attribute_definitions.4", + { + "name": "type", + "type": "character varying(32)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "search_attribute_definitions.5", + { + "name": "created_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "search_attribute_definitions.6", + { + "name": "updated_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_child_calls_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.10", + { + "name": "parent_close_policy", + "type": "character varying(32)", + "default": "'abandon'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.11", + { + "name": "connection", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.12", + { + "name": "queue", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.13", + { + "name": "compatibility", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.14", + { + "name": "retry_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.15", + { + "name": "timeout_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.16", + { + "name": "cancellation_propagation", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.17", + { + "name": "status", + "type": "character varying(32)", + "default": "'scheduled'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.18", + { + "name": "result_payload_reference", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.19", + { + "name": "failure_reference", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.2", + { + "name": "parent_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.20", + { + "name": "closed_reason", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.21", + { + "name": "scheduled_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.22", + { + "name": "started_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.23", + { + "name": "closed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.24", + { + "name": "arguments", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.25", + { + "name": "metadata", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.26", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.27", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.3", + { + "name": "parent_workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.4", + { + "name": "sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.5", + { + "name": "child_workflow_type", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.6", + { + "name": "child_workflow_class", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.7", + { + "name": "requested_child_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.8", + { + "name": "resolved_child_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_calls.9", + { + "name": "resolved_child_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_projection_repairs.1", + { + "name": "workflow_history_event_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_projection_repairs.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_projection_repairs.3", + { + "name": "workflow_task_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_projection_repairs.4", + { + "name": "history_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_projection_repairs.5", + { + "name": "failure_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_child_projection_repairs.6", + { + "name": "failed_child_counted_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_projection_repairs.7", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_child_projection_repairs.8", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_commands.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.10", + { + "name": "request_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.11", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.12", + { + "name": "outcome", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.13", + { + "name": "workflow_class", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.14", + { + "name": "workflow_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.15", + { + "name": "payload_codec", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.16", + { + "name": "payload", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.17", + { + "name": "rejection_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.18", + { + "name": "command_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_commands.19", + { + "name": "message_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_commands.2", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.20", + { + "name": "accepted_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_commands.21", + { + "name": "applied_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_commands.22", + { + "name": "rejected_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_commands.23", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_commands.24", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_commands.3", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.4", + { + "name": "requested_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.5", + { + "name": "resolved_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.6", + { + "name": "command_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.7", + { + "name": "target_scope", + "type": "character varying(255)", + "default": "'instance'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.8", + { + "name": "source", + "type": "character varying(255)", + "default": "'php'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_commands.9", + { + "name": "context", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_durable_stream_items_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.10", + { + "name": "payload", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.11", + { + "name": "payload_reference", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.12", + { + "name": "payload_codec", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.13", + { + "name": "item_type", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.14", + { + "name": "content_type", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.15", + { + "name": "emitted_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.16", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.17", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.2", + { + "name": "stream_id", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.3", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.4", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.5", + { + "name": "stream_name", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.6", + { + "name": "offset", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.7", + { + "name": "idempotency_key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.8", + { + "name": "origin", + "type": "character varying(64)", + "default": "'workflow_command'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_stream_items.9", + { + "name": "origin_reference", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_durable_streams_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.10", + { + "name": "opened_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.11", + { + "name": "last_appended_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.12", + { + "name": "closed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.13", + { + "name": "error_reason", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.14", + { + "name": "pending_items", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.15", + { + "name": "metadata", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.16", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.17", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.2", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.3", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.4", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.5", + { + "name": "stream_name", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.6", + { + "name": "status", + "type": "character varying(16)", + "default": "'open'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.7", + { + "name": "last_offset", + "type": "bigint", + "default": "'-1'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.8", + { + "name": "total_items", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_durable_streams.9", + { + "name": "retention_seconds", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_failures.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_failures.10", + { + "name": "message", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_failures.11", + { + "name": "file", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_failures.12", + { + "name": "line", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_failures.13", + { + "name": "trace_preview", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_failures.14", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_failures.15", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_failures.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_failures.3", + { + "name": "source_kind", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_failures.4", + { + "name": "source_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_failures.5", + { + "name": "propagation_kind", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_failures.6", + { + "name": "failure_category", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_failures.7", + { + "name": "non_retryable", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_failures.8", + { + "name": "handled", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_failures.9", + { + "name": "exception_class", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_history_events.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_history_events.10", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_history_events.11", + { + "name": "recorded_at_utc", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_history_events.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_history_events.3", + { + "name": "sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_history_events.4", + { + "name": "event_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_history_events.5", + { + "name": "payload", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_history_events.6", + { + "name": "workflow_task_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_history_events.7", + { + "name": "workflow_command_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_history_events.8", + { + "name": "recorded_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_history_events.9", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_inbound_stream_items_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.10", + { + "name": "payload_hash", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.11", + { + "name": "delivered_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.12", + { + "name": "workflow_command_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.13", + { + "name": "delivered_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.14", + { + "name": "consumed_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.15", + { + "name": "consumed_task_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.16", + { + "name": "consumed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.17", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.18", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.19", + { + "name": "payload_released_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.2", + { + "name": "stream_id", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.3", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.4", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.5", + { + "name": "stream_name", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.6", + { + "name": "message_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.7", + { + "name": "position", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.8", + { + "name": "payload_codec", + "type": "character varying(32)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_stream_items.9", + { + "name": "payload_blob", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_inbound_streams_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.10", + { + "name": "waiting_since", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.11", + { + "name": "duplicate_count", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.12", + { + "name": "malformed_count", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.13", + { + "name": "last_input_outcome", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.14", + { + "name": "last_input_message_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.15", + { + "name": "last_input_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.16", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.17", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.18", + { + "name": "cleanup_blocked_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.19", + { + "name": "cleanup_blocked_reason", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.2", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.20", + { + "name": "cleanup_blocked_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.3", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.4", + { + "name": "stream_name", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.5", + { + "name": "last_position", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.6", + { + "name": "cursor_position", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.7", + { + "name": "cursor_checkpoint_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.8", + { + "name": "waiting_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_inbound_streams.9", + { + "name": "waiting_after_position", + "type": "bigint", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_instances.1", + { + "name": "id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_instances.10", + { + "name": "run_count", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_instances.11", + { + "name": "last_message_sequence", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_instances.12", + { + "name": "reserved_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_instances.13", + { + "name": "started_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_instances.14", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_instances.15", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_instances.2", + { + "name": "workflow_class", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_instances.3", + { + "name": "workflow_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_instances.4", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_instances.5", + { + "name": "business_key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_instances.6", + { + "name": "visibility_labels", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_instances.7", + { + "name": "memo", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_instances.8", + { + "name": "execution_timeout_seconds", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_instances.9", + { + "name": "current_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_links.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_links.10", + { + "name": "parent_close_policy", + "type": "character varying(255)", + "default": "'abandon'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_links.11", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_links.12", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_links.2", + { + "name": "link_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_links.3", + { + "name": "sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_links.4", + { + "name": "parallel_group_path", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_links.5", + { + "name": "parent_workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_links.6", + { + "name": "parent_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_links.7", + { + "name": "child_workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_links.8", + { + "name": "child_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_links.9", + { + "name": "is_primary_parent", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_memos.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_memos_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_memos.10", + { + "name": "portable_value", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_memos.11", + { + "name": "portable_value_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_memos.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_memos.3", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_memos.4", + { + "name": "key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_memos.5", + { + "name": "value", + "type": "json", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_memos.6", + { + "name": "upserted_at_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_memos.7", + { + "name": "inherited_from_parent", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_memos.8", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_memos.9", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_messages_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.10", + { + "name": "target_workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.11", + { + "name": "target_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.12", + { + "name": "correlation_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.13", + { + "name": "idempotency_key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.14", + { + "name": "payload_reference", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.15", + { + "name": "consume_state", + "type": "character varying(16)", + "default": "'pending'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.16", + { + "name": "consumed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.17", + { + "name": "consumed_by_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.18", + { + "name": "expires_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.19", + { + "name": "delivery_attempt_count", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.2", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.20", + { + "name": "last_delivery_attempt_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.21", + { + "name": "last_delivery_error", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.22", + { + "name": "metadata", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.23", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.24", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.3", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.4", + { + "name": "direction", + "type": "character varying(16)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.5", + { + "name": "channel", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.6", + { + "name": "stream_key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.7", + { + "name": "sequence", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_messages.8", + { + "name": "source_workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_messages.9", + { + "name": "source_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_namespaces.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_namespaces_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_namespaces.2", + { + "name": "name", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_namespaces.3", + { + "name": "description", + "type": "character varying(1000)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_namespaces.4", + { + "name": "retention_days", + "type": "integer", + "default": "30", + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_namespaces.5", + { + "name": "status", + "type": "character varying(32)", + "default": "'active'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_namespaces.6", + { + "name": "created_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_namespaces.7", + { + "name": "updated_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_namespaces.8", + { + "name": "external_payload_storage", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_namespaces.9", + { + "name": "retention_mode", + "type": "character varying(32)", + "default": "'bounded'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_namespaces.external_payload_storage_generation", + { + "name": "external_payload_storage_generation", + "type": "bigint", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.1", + { + "name": "id", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.10", + { + "name": "is_primary_parent", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.11", + { + "name": "related_workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.12", + { + "name": "related_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.13", + { + "name": "related_run_number", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.14", + { + "name": "related_workflow_type", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.15", + { + "name": "related_workflow_class", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.16", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.17", + { + "name": "status_bucket", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.18", + { + "name": "closed_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.19", + { + "name": "linked_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.20", + { + "name": "payload", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.21", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.22", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.3", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.4", + { + "name": "direction", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.5", + { + "name": "lineage_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.6", + { + "name": "position", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.7", + { + "name": "link_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.8", + { + "name": "child_call_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_lineage_entries.9", + { + "name": "sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.10", + { + "name": "compatibility", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.11", + { + "name": "declared_entry_mode", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.12", + { + "name": "declared_contract_source", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.13", + { + "name": "business_key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.14", + { + "name": "visibility_labels", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.15", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.16", + { + "name": "status_bucket", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.17", + { + "name": "closed_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.18", + { + "name": "connection", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.19", + { + "name": "queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.2", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.20", + { + "name": "started_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.21", + { + "name": "sort_timestamp", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.22", + { + "name": "sort_key", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.23", + { + "name": "closed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.24", + { + "name": "archived_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.25", + { + "name": "archive_command_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.26", + { + "name": "archive_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.27", + { + "name": "duration_ms", + "type": "bigint", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.28", + { + "name": "wait_kind", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.29", + { + "name": "wait_reason", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.3", + { + "name": "run_number", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.30", + { + "name": "wait_started_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.31", + { + "name": "wait_deadline_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.32", + { + "name": "open_wait_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.33", + { + "name": "resume_source_kind", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.34", + { + "name": "resume_source_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.35", + { + "name": "next_task_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.36", + { + "name": "liveness_state", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.37", + { + "name": "liveness_reason", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.38", + { + "name": "repair_blocked_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.39", + { + "name": "repair_attention", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.4", + { + "name": "is_current_run", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.40", + { + "name": "task_problem", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.41", + { + "name": "next_task_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.42", + { + "name": "next_task_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.43", + { + "name": "next_task_status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.44", + { + "name": "next_task_lease_expires_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.45", + { + "name": "exception_count", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.46", + { + "name": "history_event_count", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.47", + { + "name": "history_size_bytes", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.48", + { + "name": "continue_as_new_recommended", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.49", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.5", + { + "name": "engine_source", + "type": "character varying(255)", + "default": "'v2'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.50", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.51", + { + "name": "history_fan_out", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.52", + { + "name": "history_budget_pressure", + "type": "character varying(32)", + "default": "'ok'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.6", + { + "name": "projection_schema_version", + "type": "smallint", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.7", + { + "name": "class", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.8", + { + "name": "workflow_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_summaries.9", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.1", + { + "name": "id", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.10", + { + "name": "source_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.11", + { + "name": "summary", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.12", + { + "name": "recorded_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.13", + { + "name": "command_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.14", + { + "name": "command_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.15", + { + "name": "task_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.16", + { + "name": "activity_execution_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.17", + { + "name": "timer_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.18", + { + "name": "failure_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.19", + { + "name": "payload", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.20", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.21", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.3", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.4", + { + "name": "history_event_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.5", + { + "name": "sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.6", + { + "name": "type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.7", + { + "name": "kind", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.8", + { + "name": "entry_kind", + "type": "character varying(255)", + "default": "'point'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timeline_entries.9", + { + "name": "source_kind", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.1", + { + "name": "id", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.10", + { + "name": "delay_seconds", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.11", + { + "name": "fire_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.12", + { + "name": "fired_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.13", + { + "name": "cancelled_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.14", + { + "name": "timer_kind", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.15", + { + "name": "condition_wait_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.16", + { + "name": "condition_key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.17", + { + "name": "condition_definition_fingerprint", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.18", + { + "name": "history_authority", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.19", + { + "name": "history_unsupported_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.20", + { + "name": "payload", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.21", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.22", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.3", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.4", + { + "name": "timer_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.5", + { + "name": "schema_version", + "type": "smallint", + "default": "'1'::smallint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.6", + { + "name": "position", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.7", + { + "name": "sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.8", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timer_entries.9", + { + "name": "source_status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timers.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timers.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timers.3", + { + "name": "sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timers.4", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_timers.5", + { + "name": "delay_seconds", + "type": "bigint", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timers.6", + { + "name": "fire_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timers.7", + { + "name": "fired_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timers.8", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_timers.9", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.1", + { + "name": "id", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.10", + { + "name": "summary", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.11", + { + "name": "opened_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.12", + { + "name": "deadline_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.13", + { + "name": "resolved_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.14", + { + "name": "target_name", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.15", + { + "name": "target_type", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.16", + { + "name": "task_backed", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.17", + { + "name": "external_only", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.18", + { + "name": "resume_source_kind", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.19", + { + "name": "resume_source_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.20", + { + "name": "task_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.21", + { + "name": "task_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.22", + { + "name": "task_status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.23", + { + "name": "command_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.24", + { + "name": "command_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.25", + { + "name": "command_status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.26", + { + "name": "command_outcome", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.27", + { + "name": "history_authority", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.28", + { + "name": "history_unsupported_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.29", + { + "name": "payload", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.3", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.30", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.31", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.4", + { + "name": "wait_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.5", + { + "name": "position", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.6", + { + "name": "kind", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.7", + { + "name": "sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.8", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_run_waits.9", + { + "name": "source_status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.10", + { + "name": "closed_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.11", + { + "name": "compatibility", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.12", + { + "name": "payload_codec", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.13", + { + "name": "arguments", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.14", + { + "name": "output", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.15", + { + "name": "output_payload_codec", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.16", + { + "name": "connection", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.17", + { + "name": "queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.18", + { + "name": "sticky_worker_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.19", + { + "name": "sticky_until", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.2", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.20", + { + "name": "last_history_sequence", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.21", + { + "name": "last_command_sequence", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.22", + { + "name": "message_cursor_position", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.23", + { + "name": "run_timeout_seconds", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.24", + { + "name": "execution_deadline_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.25", + { + "name": "run_deadline_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.26", + { + "name": "started_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.27", + { + "name": "closed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.28", + { + "name": "archived_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.29", + { + "name": "archive_command_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.3", + { + "name": "run_number", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.30", + { + "name": "archive_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.31", + { + "name": "last_progress_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.32", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.33", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.34", + { + "name": "import_source", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.35", + { + "name": "import_id", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.36", + { + "name": "import_dedupe_key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.37", + { + "name": "import_contract_version", + "type": "smallint", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.38", + { + "name": "imported_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.39", + { + "name": "priority", + "type": "smallint", + "default": "'5'::smallint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.4", + { + "name": "workflow_class", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.40", + { + "name": "fairness_key", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.41", + { + "name": "fairness_weight", + "type": "smallint", + "default": "'1'::smallint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.42", + { + "name": "cancellation_request_command_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.43", + { + "name": "cancellation_requested_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.44", + { + "name": "cancellation_deadline_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.45", + { + "name": "cancellation_delivery_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.46", + { + "name": "cancellation_delivered_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.47", + { + "name": "details_pruned_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.48", + { + "name": "cancellation_scope_recovery_until", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.5", + { + "name": "workflow_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.6", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.7", + { + "name": "business_key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_runs.8", + { + "name": "visibility_labels", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_runs.9", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.10", + { + "name": "recorded_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.11", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.12", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.13", + { + "name": "occurrence_at_utc", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.2", + { + "name": "workflow_schedule_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.3", + { + "name": "schedule_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.4", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.5", + { + "name": "sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.6", + { + "name": "event_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.7", + { + "name": "payload", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.8", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedule_history_events.9", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.10", + { + "name": "search_attributes", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.11", + { + "name": "visibility_labels", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.12", + { + "name": "jitter_seconds", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.13", + { + "name": "max_runs", + "type": "bigint", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.14", + { + "name": "remaining_actions", + "type": "bigint", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.15", + { + "name": "fires_count", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.16", + { + "name": "failures_count", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.17", + { + "name": "recent_actions", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.18", + { + "name": "buffered_actions", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.19", + { + "name": "last_fired_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.2", + { + "name": "schedule_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.20", + { + "name": "next_fire_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.21", + { + "name": "latest_workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.22", + { + "name": "connection", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.23", + { + "name": "queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.24", + { + "name": "paused_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.25", + { + "name": "deleted_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.26", + { + "name": "last_skip_reason", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.27", + { + "name": "last_skipped_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.28", + { + "name": "skipped_trigger_count", + "type": "bigint", + "default": "'0'::bigint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.29", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.3", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.30", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.31", + { + "name": "dispatch_summary", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.4", + { + "name": "spec", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.5", + { + "name": "action", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_schedules.6", + { + "name": "status", + "type": "character varying(16)", + "default": "'active'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.7", + { + "name": "overlap_policy", + "type": "character varying(32)", + "default": "'skip'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.8", + { + "name": "note", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_schedules.9", + { + "name": "memo", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_search_attributes_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.10", + { + "name": "value_bool", + "type": "boolean", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.11", + { + "name": "value_datetime", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.12", + { + "name": "upserted_at_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.13", + { + "name": "inherited_from_parent", + "type": "boolean", + "default": "false", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.14", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.15", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.16", + { + "name": "value_keyword_list", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.3", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.4", + { + "name": "key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.5", + { + "name": "type", + "type": "character varying(16)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.6", + { + "name": "value_string", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.7", + { + "name": "value_keyword", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.8", + { + "name": "value_int", + "type": "bigint", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_search_attributes.9", + { + "name": "value_float", + "type": "double precision", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.10", + { + "name": "caller_workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.11", + { + "name": "caller_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.12", + { + "name": "target_namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.13", + { + "name": "linked_workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.14", + { + "name": "linked_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.15", + { + "name": "linked_workflow_update_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.16", + { + "name": "status", + "type": "character varying(32)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.17", + { + "name": "outcome", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.18", + { + "name": "operation_mode", + "type": "character varying(32)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.19", + { + "name": "resolved_binding_kind", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.2", + { + "name": "workflow_service_endpoint_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.20", + { + "name": "resolved_target_reference", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.21", + { + "name": "payload_codec", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.22", + { + "name": "input_payload_reference", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.23", + { + "name": "output_payload_reference", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.24", + { + "name": "failure_payload_reference", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.25", + { + "name": "failure_message", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.26", + { + "name": "idempotency_key", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.27", + { + "name": "deadline_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.28", + { + "name": "idempotency_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.29", + { + "name": "cancellation_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.3", + { + "name": "workflow_service_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.30", + { + "name": "retry_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.31", + { + "name": "boundary_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.32", + { + "name": "metadata", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.33", + { + "name": "outcome_category", + "type": "character varying(32)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.34", + { + "name": "outcome_reason", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.35", + { + "name": "outcome_message", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.36", + { + "name": "outcome_metadata", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.37", + { + "name": "policy_name", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.38", + { + "name": "retry_after_seconds", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.39", + { + "name": "caller_principal_subject", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.4", + { + "name": "workflow_service_operation_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.40", + { + "name": "caller_principal_method", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.41", + { + "name": "caller_principal_roles", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.42", + { + "name": "caller_principal_tenant", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.43", + { + "name": "caller_principal_claims", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.44", + { + "name": "accepted_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.45", + { + "name": "started_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.46", + { + "name": "completed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.47", + { + "name": "failed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.48", + { + "name": "cancelled_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.49", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.5", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.50", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.6", + { + "name": "endpoint_name", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.7", + { + "name": "service_name", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.8", + { + "name": "operation_name", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_calls.9", + { + "name": "caller_namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_endpoints.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_endpoints.2", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_endpoints.3", + { + "name": "endpoint_name", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_endpoints.4", + { + "name": "description", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_endpoints.5", + { + "name": "boundary_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_endpoints.6", + { + "name": "metadata", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_endpoints.7", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_endpoints.8", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.10", + { + "name": "handler_binding", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.11", + { + "name": "deadline_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.12", + { + "name": "idempotency_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.13", + { + "name": "cancellation_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.14", + { + "name": "retry_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.15", + { + "name": "boundary_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.16", + { + "name": "metadata", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.17", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.18", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.2", + { + "name": "workflow_service_endpoint_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.3", + { + "name": "workflow_service_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.4", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.5", + { + "name": "operation_name", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.6", + { + "name": "description", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.7", + { + "name": "operation_mode", + "type": "character varying(32)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.8", + { + "name": "handler_binding_kind", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_service_operations.9", + { + "name": "handler_target_reference", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_services.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_services.2", + { + "name": "workflow_service_endpoint_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_services.3", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_services.4", + { + "name": "service_name", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_services.5", + { + "name": "description", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_services.6", + { + "name": "boundary_policy", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_services.7", + { + "name": "metadata", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_services.8", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_services.9", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.10", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.11", + { + "name": "outcome", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.12", + { + "name": "command_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.13", + { + "name": "workflow_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.14", + { + "name": "payload_codec", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.15", + { + "name": "arguments", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.16", + { + "name": "validation_errors", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.17", + { + "name": "rejection_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.18", + { + "name": "received_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.19", + { + "name": "applied_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.2", + { + "name": "workflow_command_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.20", + { + "name": "rejected_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.21", + { + "name": "closed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.22", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.23", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.3", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.4", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.5", + { + "name": "target_scope", + "type": "character varying(255)", + "default": "'instance'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.6", + { + "name": "requested_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.7", + { + "name": "resolved_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.8", + { + "name": "signal_name", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_signal_records.9", + { + "name": "signal_wait_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_task_poll_cursors.1", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_task_poll_cursors.2", + { + "name": "task_queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_task_poll_cursors.3", + { + "name": "next_task_kind", + "type": "character varying(32)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_task_poll_cursors.4", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_task_poll_cursors.5", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.10", + { + "name": "sticky_worker_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.11", + { + "name": "sticky_until", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.12", + { + "name": "sticky_replay_mode", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.13", + { + "name": "sticky_claimed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.14", + { + "name": "available_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.15", + { + "name": "leased_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.16", + { + "name": "lease_owner", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.17", + { + "name": "lease_expires_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.18", + { + "name": "attempt_count", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.19", + { + "name": "last_dispatch_attempt_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.2", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.20", + { + "name": "last_dispatched_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.21", + { + "name": "last_dispatch_error", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.22", + { + "name": "last_claim_failed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.23", + { + "name": "last_claim_error", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.24", + { + "name": "repair_count", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.25", + { + "name": "repair_available_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.26", + { + "name": "last_error", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.27", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.28", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.29", + { + "name": "priority", + "type": "smallint", + "default": "'5'::smallint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.3", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.30", + { + "name": "fairness_key", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.31", + { + "name": "fairness_weight", + "type": "smallint", + "default": "'1'::smallint", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.4", + { + "name": "task_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.5", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.6", + { + "name": "compatibility", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.7", + { + "name": "payload", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_tasks.8", + { + "name": "connection", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.9", + { + "name": "queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_tasks.ready_origin_at", + { + "name": "ready_origin_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.10", + { + "name": "update_name", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.11", + { + "name": "request_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.12", + { + "name": "input_hash", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.13", + { + "name": "payload_codec", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.14", + { + "name": "arguments", + "type": "text", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.15", + { + "name": "command_context", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.16", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.17", + { + "name": "attempt_count", + "type": "integer", + "default": "0", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.18", + { + "name": "lease_owner", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.19", + { + "name": "lease_expires_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.2", + { + "name": "idempotency_key", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.20", + { + "name": "rejection_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.21", + { + "name": "rejection_message", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.22", + { + "name": "failure_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.23", + { + "name": "validation_errors", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.24", + { + "name": "approved_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.25", + { + "name": "rejected_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.26", + { + "name": "failed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.27", + { + "name": "timed_out_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.28", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.29", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.3", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.4", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.5", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.6", + { + "name": "workflow_type", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.7", + { + "name": "task_queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.8", + { + "name": "compatibility", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_update_validation_tasks.9", + { + "name": "workflow_definition_fingerprint", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.1", + { + "name": "id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.10", + { + "name": "outcome", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.11", + { + "name": "command_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_updates.12", + { + "name": "workflow_sequence", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_updates.13", + { + "name": "payload_codec", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.14", + { + "name": "arguments", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.15", + { + "name": "result", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.16", + { + "name": "validation_errors", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_updates.17", + { + "name": "rejection_reason", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.18", + { + "name": "failure_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.19", + { + "name": "failure_message", + "type": "text", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.2", + { + "name": "workflow_command_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.20", + { + "name": "accepted_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_updates.21", + { + "name": "applied_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_updates.22", + { + "name": "rejected_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_updates.23", + { + "name": "closed_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_updates.24", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_updates.25", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_updates.3", + { + "name": "workflow_instance_id", + "type": "character varying(191)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.4", + { + "name": "workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.5", + { + "name": "target_scope", + "type": "character varying(255)", + "default": "'instance'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.6", + { + "name": "requested_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.7", + { + "name": "resolved_workflow_run_id", + "type": "character varying(26)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.8", + { + "name": "update_name", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_updates.9", + { + "name": "status", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_worker_build_id_rollouts_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.10", + { + "name": "rolled_back_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.11", + { + "name": "required_compatibility", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.12", + { + "name": "recorded_fingerprint", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.13", + { + "name": "compatibility_policy", + "type": "character varying(32)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.14", + { + "name": "workflow_types", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.2", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.3", + { + "name": "task_queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.4", + { + "name": "build_id", + "type": "character varying(255)", + "default": "''::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.5", + { + "name": "drain_intent", + "type": "character varying(32)", + "default": "'active'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.6", + { + "name": "drained_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.7", + { + "name": "created_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.8", + { + "name": "updated_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_build_id_rollouts.9", + { + "name": "promoted_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_worker_compatibility_heartbeats_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.10", + { + "name": "recorded_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.11", + { + "name": "expires_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.12", + { + "name": "created_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.13", + { + "name": "updated_at", + "type": "timestamp(6) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.2", + { + "name": "worker_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.3", + { + "name": "scope_key", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.4", + { + "name": "namespace", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.5", + { + "name": "host", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.6", + { + "name": "process_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.7", + { + "name": "connection", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.8", + { + "name": "queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_compatibility_heartbeats.9", + { + "name": "supported", + "type": "json", + "default": null, + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_worker_registrations_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.10", + { + "name": "supported_activity_types", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.11", + { + "name": "max_concurrent_workflow_tasks", + "type": "integer", + "default": "100", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.12", + { + "name": "max_concurrent_activity_tasks", + "type": "integer", + "default": "100", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.13", + { + "name": "last_heartbeat_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.14", + { + "name": "status", + "type": "character varying(32)", + "default": "'active'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.15", + { + "name": "created_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.16", + { + "name": "updated_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.17", + { + "name": "capabilities", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.18", + { + "name": "max_concurrent_worker_sessions", + "type": "integer", + "default": "10", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.19", + { + "name": "available_workflow_slots", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.2", + { + "name": "worker_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.20", + { + "name": "available_activity_slots", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.21", + { + "name": "available_session_slots", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.22", + { + "name": "process_metrics", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.23", + { + "name": "heartbeat_interval_seconds", + "type": "integer", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.24", + { + "name": "workflow_command_contracts", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.25", + { + "name": "capability_manifest", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.3", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.4", + { + "name": "task_queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.5", + { + "name": "runtime", + "type": "character varying(32)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.6", + { + "name": "sdk_version", + "type": "character varying(64)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.7", + { + "name": "build_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.8", + { + "name": "supported_workflow_types", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_registrations.9", + { + "name": "workflow_definition_fingerprints", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.1", + { + "name": "id", + "type": "bigint", + "default": "nextval('workflow_worker_sessions_id_seq'::regclass)", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.10", + { + "name": "ttl_expires_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.11", + { + "name": "closed_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.12", + { + "name": "failure_reason", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.13", + { + "name": "lease_seconds", + "type": "integer", + "default": "120", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.14", + { + "name": "ttl_seconds", + "type": "integer", + "default": "1800", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.15", + { + "name": "max_concurrent_activities", + "type": "integer", + "default": "1", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.16", + { + "name": "create_if_missing", + "type": "boolean", + "default": "true", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.17", + { + "name": "allow_reacquire_after_failure", + "type": "boolean", + "default": "true", + "identity": "", + "not_null": true, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.18", + { + "name": "last_heartbeat_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.19", + { + "name": "created_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.2", + { + "name": "namespace", + "type": "character varying(128)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.20", + { + "name": "updated_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.3", + { + "name": "session_id", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.4", + { + "name": "connection", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.5", + { + "name": "queue", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.6", + { + "name": "requirements", + "type": "json", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.7", + { + "name": "status", + "type": "character varying(32)", + "default": "'active'::character varying", + "identity": "", + "not_null": true, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.8", + { + "name": "lease_owner", + "type": "character varying(255)", + "default": null, + "identity": "", + "not_null": false, + "collation": "default", + "generated": "" + } + ], + [ + "column", + "workflow_worker_sessions.9", + { + "name": "lease_expires_at", + "type": "timestamp(0) without time zone", + "default": null, + "identity": "", + "not_null": false, + "collation": null, + "generated": "" + } + ], + [ + "constraint", + "_sqlx_migrations._sqlx_migrations_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (version)" + } + ], + [ + "constraint", + "activity_attempts.activity_attempts_activity_execution_id_attempt_number_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (activity_execution_id, attempt_number)" + } + ], + [ + "constraint", + "activity_attempts.activity_attempts_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "activity_executions.activity_executions_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "activity_executions.activity_executions_workflow_run_id_sequence_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_run_id, sequence)" + } + ], + [ + "constraint", + "dw_command_intents.dw_command_intents_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (command_id)" + } + ], + [ + "constraint", + "dw_external_payload_deletions.dw_external_payload_deletions_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "dw_poll_receipts.dw_poll_receipts_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (namespace, worker_id, kind, request_id)" + } + ], + [ + "constraint", + "dw_poll_receipts.dw_poll_receipts_task_id_fkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "FOREIGN KEY (task_id) REFERENCES workflow_tasks(id) ON DELETE CASCADE" + } + ], + [ + "constraint", + "dw_query_cache.dw_query_cache_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (key)" + } + ], + [ + "constraint", + "dw_run_command_contracts.dw_run_command_contracts_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (workflow_run_id)" + } + ], + [ + "constraint", + "dw_service_admission_counters.dw_service_admission_counters_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (cache_key)" + } + ], + [ + "constraint", + "dw_service_call_deadlines.dw_service_call_deadlines_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (service_call_id)" + } + ], + [ + "constraint", + "dw_stream_reclaims.dw_stream_reclaims_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (stream_id)" + } + ], + [ + "constraint", + "dw_task_completions.dw_task_completions_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (task_id)" + } + ], + [ + "constraint", + "dw_task_completions.dw_task_completions_task_id_fkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "FOREIGN KEY (task_id) REFERENCES workflow_tasks(id) ON DELETE CASCADE" + } + ], + [ + "constraint", + "dw_task_queue_pauses.dw_task_queue_pauses_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (namespace, task_queue)" + } + ], + [ + "constraint", + "dw_worker_registration_incarnations.dw_worker_incarnation_state", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "CHECK ((((status = 'active'::text) AND (finished_at IS NULL) AND (recovered_workflow_task_count IS NULL)) OR ((status = 'superseded'::text) AND (finished_at IS NOT NULL) AND (recovered_workflow_task_count IS NULL)) OR ((status = 'deregistered'::text) AND (finished_at IS NOT NULL) AND (recovered_workflow_task_count IS NOT NULL) AND (recovered_workflow_task_count >= 0))))" + } + ], + [ + "constraint", + "dw_worker_registration_incarnations.dw_worker_registration_incarnations_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (token)" + } + ], + [ + "constraint", + "dw_worker_session_holders.dw_worker_session_holders_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (namespace, session_id)" + } + ], + [ + "constraint", + "failed_jobs.failed_jobs_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "failed_jobs.failed_jobs_uuid_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (uuid)" + } + ], + [ + "constraint", + "jobs.jobs_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "migrations.migrations_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "runtime_credentials.runtime_credentials_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "runtime_credentials.runtime_credentials_token_hash_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (token_hash)" + } + ], + [ + "constraint", + "runtime_external_payload_backup_hold.runtime_external_payload_backup_hold_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "runtime_external_payload_cleanup_stats.runtime_external_payload_cleanup_stats_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (namespace)" + } + ], + [ + "constraint", + "runtime_external_payload_object_locks.runtime_external_payload_object_locks_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (bucket)" + } + ], + [ + "constraint", + "runtime_external_payloads.runtime_external_payloads_namespace_uri_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (namespace, storage_uri_sha256)" + } + ], + [ + "constraint", + "runtime_external_payloads.runtime_external_payloads_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "runtime_payload_completion_budgets.runtime_payload_completion_budgets_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "search_attribute_definitions.search_attribute_definitions_namespace_name_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (namespace, name)" + } + ], + [ + "constraint", + "search_attribute_definitions.search_attribute_definitions_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_child_calls.workflow_child_calls_parent_workflow_run_id_foreign", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "FOREIGN KEY (parent_workflow_run_id) REFERENCES workflow_runs(id) ON DELETE CASCADE" + } + ], + [ + "constraint", + "workflow_child_calls.workflow_child_calls_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_child_projection_repairs.workflow_child_projection_repairs_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (workflow_history_event_id)" + } + ], + [ + "constraint", + "workflow_commands.workflow_commands_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_commands.workflow_commands_request_lookup", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_instance_id, command_type, request_id)" + } + ], + [ + "constraint", + "workflow_durable_stream_items.wf_durable_stream_items_idempotency_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (stream_id, idempotency_key)" + } + ], + [ + "constraint", + "workflow_durable_stream_items.wf_durable_stream_items_stream_offset_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (stream_id, \"offset\")" + } + ], + [ + "constraint", + "workflow_durable_stream_items.workflow_durable_stream_items_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_durable_stream_items.workflow_durable_stream_items_stream_id_foreign", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "FOREIGN KEY (stream_id) REFERENCES workflow_durable_streams(id) ON DELETE CASCADE" + } + ], + [ + "constraint", + "workflow_durable_streams.wf_durable_streams_run_name_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_run_id, stream_name)" + } + ], + [ + "constraint", + "workflow_durable_streams.workflow_durable_streams_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_failures.workflow_failures_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_history_events.workflow_history_events_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_history_events.workflow_history_events_workflow_run_id_sequence_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_run_id, sequence)" + } + ], + [ + "constraint", + "workflow_inbound_stream_items.wf_inbound_items_stream_message_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (stream_id, message_id)" + } + ], + [ + "constraint", + "workflow_inbound_stream_items.wf_inbound_items_stream_position_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (stream_id, \"position\")" + } + ], + [ + "constraint", + "workflow_inbound_stream_items.workflow_inbound_stream_items_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_inbound_stream_items.workflow_inbound_stream_items_stream_id_foreign", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "FOREIGN KEY (stream_id) REFERENCES workflow_inbound_streams(id) ON DELETE CASCADE" + } + ], + [ + "constraint", + "workflow_inbound_streams.wf_inbound_streams_ns_instance_name_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (namespace, workflow_instance_id, stream_name)" + } + ], + [ + "constraint", + "workflow_inbound_streams.workflow_inbound_streams_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_instances.workflow_instances_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_links.workflow_links_parent_child_type_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (parent_workflow_run_id, child_workflow_run_id, link_type)" + } + ], + [ + "constraint", + "workflow_links.workflow_links_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_memos.workflow_memos_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_memos.workflow_memos_run_key_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_run_id, key)" + } + ], + [ + "constraint", + "workflow_memos.workflow_memos_workflow_run_id_foreign", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "FOREIGN KEY (workflow_run_id) REFERENCES workflow_runs(id) ON DELETE CASCADE" + } + ], + [ + "constraint", + "workflow_messages.wf_msgs_stream_seq_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_instance_id, stream_key, sequence)" + } + ], + [ + "constraint", + "workflow_messages.workflow_messages_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_messages.workflow_messages_workflow_run_id_foreign", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "FOREIGN KEY (workflow_run_id) REFERENCES workflow_runs(id) ON DELETE CASCADE" + } + ], + [ + "constraint", + "workflow_namespaces.workflow_namespaces_name_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (name)" + } + ], + [ + "constraint", + "workflow_namespaces.workflow_namespaces_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_run_lineage_entries.workflow_run_lineage_entries_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_run_lineage_entries.workflow_run_lineage_run_direction_lineage_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_run_id, direction, lineage_id)" + } + ], + [ + "constraint", + "workflow_run_summaries.workflow_run_summaries_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_run_timeline_entries.workflow_run_timeline_entries_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_run_timeline_entries.workflow_run_timeline_run_event_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_run_id, history_event_id)" + } + ], + [ + "constraint", + "workflow_run_timer_entries.workflow_run_timer_entries_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_run_timer_entries.workflow_run_timer_entries_run_timer_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_run_id, timer_id)" + } + ], + [ + "constraint", + "workflow_run_timers.workflow_run_timers_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_run_timers.workflow_run_timers_workflow_run_id_sequence_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_run_id, sequence)" + } + ], + [ + "constraint", + "workflow_run_waits.workflow_run_waits_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_run_waits.workflow_run_waits_run_wait_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_run_id, wait_id)" + } + ], + [ + "constraint", + "workflow_runs.workflow_runs_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_runs.workflow_runs_workflow_instance_id_run_number_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_instance_id, run_number)" + } + ], + [ + "constraint", + "workflow_schedule_history_events.wf_schedule_history_schedule_sequence_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_schedule_id, sequence)" + } + ], + [ + "constraint", + "workflow_schedule_history_events.workflow_schedule_history_events_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_schedules.workflow_schedules_namespace_schedule_id_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (namespace, schedule_id)" + } + ], + [ + "constraint", + "workflow_schedules.workflow_schedules_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_search_attributes.workflow_search_attributes_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_search_attributes.workflow_search_attributes_workflow_run_id_foreign", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "FOREIGN KEY (workflow_run_id) REFERENCES workflow_runs(id) ON DELETE CASCADE" + } + ], + [ + "constraint", + "workflow_search_attributes.workflow_search_attrs_run_key_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_run_id, key)" + } + ], + [ + "constraint", + "workflow_service_calls.workflow_service_calls_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_service_endpoints.wf_service_endpoints_namespace_name_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (namespace, endpoint_name)" + } + ], + [ + "constraint", + "workflow_service_endpoints.workflow_service_endpoints_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_service_operations.wf_service_ops_namespace_service_name_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (namespace, workflow_service_id, operation_name)" + } + ], + [ + "constraint", + "workflow_service_operations.workflow_service_operations_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_services.wf_services_namespace_endpoint_name_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (namespace, workflow_service_endpoint_id, service_name)" + } + ], + [ + "constraint", + "workflow_services.workflow_services_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_signal_records.workflow_signal_records_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_signal_records.workflow_signal_records_workflow_command_id_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_command_id)" + } + ], + [ + "constraint", + "workflow_task_poll_cursors.workflow_task_poll_cursors_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (namespace, task_queue)" + } + ], + [ + "constraint", + "workflow_tasks.workflow_tasks_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_update_validation_tasks.workflow_update_validation_tasks_idempotency_key_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (idempotency_key)" + } + ], + [ + "constraint", + "workflow_update_validation_tasks.workflow_update_validation_tasks_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_updates.workflow_updates_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_updates.workflow_updates_workflow_command_id_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (workflow_command_id)" + } + ], + [ + "constraint", + "workflow_worker_build_id_rollouts.workflow_build_id_rollouts_scope_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (namespace, task_queue, build_id)" + } + ], + [ + "constraint", + "workflow_worker_build_id_rollouts.workflow_worker_build_id_rollouts_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_worker_compatibility_heartbeats.workflow_worker_compatibility_heartbeats_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_worker_compatibility_heartbeats.workflow_worker_compatibility_heartbeats_scope_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (worker_id, scope_key)" + } + ], + [ + "constraint", + "workflow_worker_registrations.workflow_worker_registrations_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "constraint", + "workflow_worker_registrations.workflow_worker_registrations_worker_id_namespace_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (worker_id, namespace)" + } + ], + [ + "constraint", + "workflow_worker_sessions.workflow_worker_sessions_namespace_session_id_unique", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "UNIQUE (namespace, session_id)" + } + ], + [ + "constraint", + "workflow_worker_sessions.workflow_worker_sessions_pkey", + { + "deferred": false, + "validated": true, + "deferrable": false, + "definition": "PRIMARY KEY (id)" + } + ], + [ + "index", + "_sqlx_migrations_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX _sqlx_migrations_pkey ON public._sqlx_migrations USING btree (version)" + } + ], + [ + "index", + "activity_attempts_activity_execution_id_attempt_number_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX activity_attempts_activity_execution_id_attempt_number_unique ON public.activity_attempts USING btree (activity_execution_id, attempt_number)" + } + ], + [ + "index", + "activity_attempts_activity_execution_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX activity_attempts_activity_execution_id_index ON public.activity_attempts USING btree (activity_execution_id)" + } + ], + [ + "index", + "activity_attempts_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX activity_attempts_pkey ON public.activity_attempts USING btree (id)" + } + ], + [ + "index", + "activity_attempts_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX activity_attempts_workflow_run_id_index ON public.activity_attempts USING btree (workflow_run_id)" + } + ], + [ + "index", + "activity_attempts_workflow_task_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX activity_attempts_workflow_task_id_index ON public.activity_attempts USING btree (workflow_task_id)" + } + ], + [ + "index", + "activity_exec_prom_metrics_series_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX activity_exec_prom_metrics_series_idx ON public.activity_executions USING btree (workflow_run_id, queue, activity_type)" + } + ], + [ + "index", + "activity_executions_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX activity_executions_pkey ON public.activity_executions USING btree (id)" + } + ], + [ + "index", + "activity_executions_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX activity_executions_workflow_run_id_index ON public.activity_executions USING btree (workflow_run_id)" + } + ], + [ + "index", + "activity_executions_workflow_run_id_sequence_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX activity_executions_workflow_run_id_sequence_unique ON public.activity_executions USING btree (workflow_run_id, sequence)" + } + ], + [ + "index", + "child_calls_child_parent", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX child_calls_child_parent ON public.workflow_child_calls USING btree (resolved_child_instance_id, parent_workflow_run_id)" + } + ], + [ + "index", + "child_calls_parent_seq", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX child_calls_parent_seq ON public.workflow_child_calls USING btree (parent_workflow_run_id, sequence)" + } + ], + [ + "index", + "child_calls_parent_status", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX child_calls_parent_status ON public.workflow_child_calls USING btree (parent_workflow_run_id, status)" + } + ], + [ + "index", + "dw_command_intents_namespace", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_command_intents_namespace ON public.dw_command_intents USING btree (namespace)" + } + ], + [ + "index", + "dw_command_intents_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_command_intents_pkey ON public.dw_command_intents USING btree (command_id)" + } + ], + [ + "index", + "dw_external_payload_deletions_due", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_external_payload_deletions_due ON public.dw_external_payload_deletions USING btree (namespace, updated_at, id)" + } + ], + [ + "index", + "dw_external_payload_deletions_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_external_payload_deletions_pkey ON public.dw_external_payload_deletions USING btree (id)" + } + ], + [ + "index", + "dw_external_payload_deletions_uri", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX dw_external_payload_deletions_uri ON public.dw_external_payload_deletions USING btree (namespace, storage_uri_sha256)" + } + ], + [ + "index", + "dw_poll_receipts_expiration", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_poll_receipts_expiration ON public.dw_poll_receipts USING btree (expires_at)" + } + ], + [ + "index", + "dw_poll_receipts_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_poll_receipts_pkey ON public.dw_poll_receipts USING btree (namespace, worker_id, kind, request_id)" + } + ], + [ + "index", + "dw_query_cache_expiration", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_query_cache_expiration ON public.dw_query_cache USING btree (expiration, key)" + } + ], + [ + "index", + "dw_query_cache_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_query_cache_pkey ON public.dw_query_cache USING btree (key)" + } + ], + [ + "index", + "dw_run_command_contracts_namespace", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_run_command_contracts_namespace ON public.dw_run_command_contracts USING btree (namespace)" + } + ], + [ + "index", + "dw_run_command_contracts_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_run_command_contracts_pkey ON public.dw_run_command_contracts USING btree (workflow_run_id)" + } + ], + [ + "index", + "dw_service_admission_counters_expiry", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_service_admission_counters_expiry ON public.dw_service_admission_counters USING btree (expires_at)" + } + ], + [ + "index", + "dw_service_admission_counters_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_service_admission_counters_pkey ON public.dw_service_admission_counters USING btree (cache_key)" + } + ], + [ + "index", + "dw_service_call_deadlines_due", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_service_call_deadlines_due ON public.dw_service_call_deadlines USING btree (call_deadline_at, service_call_id)" + } + ], + [ + "index", + "dw_service_call_deadlines_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_service_call_deadlines_pkey ON public.dw_service_call_deadlines USING btree (service_call_id)" + } + ], + [ + "index", + "dw_stream_reclaims_due", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_stream_reclaims_due ON public.dw_stream_reclaims USING btree (namespace, reclaim_at, stream_id)" + } + ], + [ + "index", + "dw_stream_reclaims_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_stream_reclaims_pkey ON public.dw_stream_reclaims USING btree (stream_id)" + } + ], + [ + "index", + "dw_task_completions_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_task_completions_pkey ON public.dw_task_completions USING btree (task_id)" + } + ], + [ + "index", + "dw_task_queue_pauses_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_task_queue_pauses_pkey ON public.dw_task_queue_pauses USING btree (namespace, task_queue)" + } + ], + [ + "index", + "dw_worker_incarnation_authority", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_worker_incarnation_authority ON public.dw_worker_registration_incarnations USING btree (namespace, worker_id, status)" + } + ], + [ + "index", + "dw_worker_incarnation_retention", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_worker_incarnation_retention ON public.dw_worker_registration_incarnations USING btree (status, finished_at)" + } + ], + [ + "index", + "dw_worker_registration_incarnations_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_worker_registration_incarnations_pkey ON public.dw_worker_registration_incarnations USING btree (token)" + } + ], + [ + "index", + "dw_worker_session_holders_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX dw_worker_session_holders_pkey ON public.dw_worker_session_holders USING btree (namespace, session_id)" + } + ], + [ + "index", + "dw_workflow_tasks_poll", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_workflow_tasks_poll ON public.workflow_tasks USING btree (namespace, queue, task_type, status, available_at)" + } + ], + [ + "index", + "dw_workflow_tasks_scoped_dispatch", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX dw_workflow_tasks_scoped_dispatch ON public.workflow_tasks USING btree (namespace COLLATE \"C\", queue COLLATE \"C\", task_type COLLATE \"C\", status COLLATE \"C\", priority, available_at, id)" + } + ], + [ + "index", + "failed_jobs_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX failed_jobs_pkey ON public.failed_jobs USING btree (id)" + } + ], + [ + "index", + "failed_jobs_uuid_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX failed_jobs_uuid_unique ON public.failed_jobs USING btree (uuid)" + } + ], + [ + "index", + "jobs_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX jobs_pkey ON public.jobs USING btree (id)" + } + ], + [ + "index", + "jobs_queue_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX jobs_queue_index ON public.jobs USING btree (queue)" + } + ], + [ + "index", + "migrations_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX migrations_pkey ON public.migrations USING btree (id)" + } + ], + [ + "index", + "runtime_credentials_expires_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX runtime_credentials_expires_at_index ON public.runtime_credentials USING btree (expires_at)" + } + ], + [ + "index", + "runtime_credentials_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX runtime_credentials_pkey ON public.runtime_credentials USING btree (id)" + } + ], + [ + "index", + "runtime_credentials_revoked_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX runtime_credentials_revoked_at_index ON public.runtime_credentials USING btree (revoked_at)" + } + ], + [ + "index", + "runtime_credentials_tenant_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX runtime_credentials_tenant_index ON public.runtime_credentials USING btree (tenant)" + } + ], + [ + "index", + "runtime_credentials_token_hash_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX runtime_credentials_token_hash_unique ON public.runtime_credentials USING btree (token_hash)" + } + ], + [ + "index", + "runtime_external_payload_backup_hold_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX runtime_external_payload_backup_hold_pkey ON public.runtime_external_payload_backup_hold USING btree (id)" + } + ], + [ + "index", + "runtime_external_payload_cleanup_stats_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX runtime_external_payload_cleanup_stats_pkey ON public.runtime_external_payload_cleanup_stats USING btree (namespace)" + } + ], + [ + "index", + "runtime_external_payload_object_locks_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX runtime_external_payload_object_locks_pkey ON public.runtime_external_payload_object_locks USING btree (bucket)" + } + ], + [ + "index", + "runtime_external_payloads_expires_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX runtime_external_payloads_expires_at_index ON public.runtime_external_payloads USING btree (expires_at)" + } + ], + [ + "index", + "runtime_external_payloads_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX runtime_external_payloads_namespace_index ON public.runtime_external_payloads USING btree (namespace)" + } + ], + [ + "index", + "runtime_external_payloads_namespace_uri_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX runtime_external_payloads_namespace_uri_unique ON public.runtime_external_payloads USING btree (namespace, storage_uri_sha256)" + } + ], + [ + "index", + "runtime_external_payloads_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX runtime_external_payloads_pkey ON public.runtime_external_payloads USING btree (id)" + } + ], + [ + "index", + "runtime_external_payloads_reclamation_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX runtime_external_payloads_reclamation_idx ON public.runtime_external_payloads USING btree (retained_at, expires_at, upload_status)" + } + ], + [ + "index", + "runtime_payload_completion_budgets_expires_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX runtime_payload_completion_budgets_expires_at_index ON public.runtime_payload_completion_budgets USING btree (expires_at)" + } + ], + [ + "index", + "runtime_payload_completion_budgets_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX runtime_payload_completion_budgets_namespace_index ON public.runtime_payload_completion_budgets USING btree (namespace)" + } + ], + [ + "index", + "runtime_payload_completion_budgets_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX runtime_payload_completion_budgets_pkey ON public.runtime_payload_completion_budgets USING btree (id)" + } + ], + [ + "index", + "search_attribute_definitions_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX search_attribute_definitions_namespace_index ON public.search_attribute_definitions USING btree (namespace)" + } + ], + [ + "index", + "search_attribute_definitions_namespace_name_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX search_attribute_definitions_namespace_name_unique ON public.search_attribute_definitions USING btree (namespace, name)" + } + ], + [ + "index", + "search_attribute_definitions_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX search_attribute_definitions_pkey ON public.search_attribute_definitions USING btree (id)" + } + ], + [ + "index", + "wf_durable_stream_items_idempotency_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_durable_stream_items_idempotency_unique ON public.workflow_durable_stream_items USING btree (stream_id, idempotency_key)" + } + ], + [ + "index", + "wf_durable_stream_items_run_name_offset_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_durable_stream_items_run_name_offset_idx ON public.workflow_durable_stream_items USING btree (workflow_run_id, stream_name, \"offset\")" + } + ], + [ + "index", + "wf_durable_stream_items_stream_offset_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_durable_stream_items_stream_offset_unique ON public.workflow_durable_stream_items USING btree (stream_id, \"offset\")" + } + ], + [ + "index", + "wf_durable_streams_ns_instance_name_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_durable_streams_ns_instance_name_idx ON public.workflow_durable_streams USING btree (namespace, workflow_instance_id, stream_name)" + } + ], + [ + "index", + "wf_durable_streams_ns_status_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_durable_streams_ns_status_idx ON public.workflow_durable_streams USING btree (namespace, status)" + } + ], + [ + "index", + "wf_durable_streams_run_name_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_durable_streams_run_name_unique ON public.workflow_durable_streams USING btree (workflow_run_id, stream_name)" + } + ], + [ + "index", + "wf_inbound_items_ns_instance_name_position_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_inbound_items_ns_instance_name_position_idx ON public.workflow_inbound_stream_items USING btree (namespace, workflow_instance_id, stream_name, \"position\")" + } + ], + [ + "index", + "wf_inbound_items_stream_message_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_inbound_items_stream_message_unique ON public.workflow_inbound_stream_items USING btree (stream_id, message_id)" + } + ], + [ + "index", + "wf_inbound_items_stream_position_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_inbound_items_stream_position_unique ON public.workflow_inbound_stream_items USING btree (stream_id, \"position\")" + } + ], + [ + "index", + "wf_inbound_streams_ns_instance_name_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_inbound_streams_ns_instance_name_unique ON public.workflow_inbound_streams USING btree (namespace, workflow_instance_id, stream_name)" + } + ], + [ + "index", + "wf_msgs_instance_stream_seq", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_msgs_instance_stream_seq ON public.workflow_messages USING btree (workflow_instance_id, stream_key, sequence)" + } + ], + [ + "index", + "wf_msgs_run_dir_state", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_msgs_run_dir_state ON public.workflow_messages USING btree (workflow_run_id, direction, consume_state)" + } + ], + [ + "index", + "wf_msgs_stream_seq_state", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_msgs_stream_seq_state ON public.workflow_messages USING btree (stream_key, sequence, consume_state)" + } + ], + [ + "index", + "wf_msgs_stream_seq_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_msgs_stream_seq_unique ON public.workflow_messages USING btree (workflow_instance_id, stream_key, sequence)" + } + ], + [ + "index", + "wf_msgs_target_state", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_msgs_target_state ON public.workflow_messages USING btree (target_workflow_instance_id, consume_state)" + } + ], + [ + "index", + "wf_schedule_history_event_recorded_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_schedule_history_event_recorded_idx ON public.workflow_schedule_history_events USING btree (event_type, recorded_at)" + } + ], + [ + "index", + "wf_schedule_history_instance_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_schedule_history_instance_idx ON public.workflow_schedule_history_events USING btree (workflow_instance_id)" + } + ], + [ + "index", + "wf_schedule_history_namespace_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_schedule_history_namespace_idx ON public.workflow_schedule_history_events USING btree (namespace)" + } + ], + [ + "index", + "wf_schedule_history_namespace_schedule_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_schedule_history_namespace_schedule_idx ON public.workflow_schedule_history_events USING btree (namespace, schedule_id)" + } + ], + [ + "index", + "wf_schedule_history_occurrence_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_schedule_history_occurrence_idx ON public.workflow_schedule_history_events USING btree (workflow_schedule_id, event_type, occurrence_at_utc)" + } + ], + [ + "index", + "wf_schedule_history_run_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_schedule_history_run_idx ON public.workflow_schedule_history_events USING btree (workflow_run_id)" + } + ], + [ + "index", + "wf_schedule_history_schedule_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_schedule_history_schedule_idx ON public.workflow_schedule_history_events USING btree (schedule_id)" + } + ], + [ + "index", + "wf_schedule_history_schedule_sequence_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_schedule_history_schedule_sequence_unique ON public.workflow_schedule_history_events USING btree (workflow_schedule_id, sequence)" + } + ], + [ + "index", + "wf_schedule_history_workflow_schedule_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_schedule_history_workflow_schedule_idx ON public.workflow_schedule_history_events USING btree (workflow_schedule_id)" + } + ], + [ + "index", + "wf_service_calls_accepted_at_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_accepted_at_idx ON public.workflow_service_calls USING btree (accepted_at)" + } + ], + [ + "index", + "wf_service_calls_binding_kind_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_binding_kind_idx ON public.workflow_service_calls USING btree (resolved_binding_kind)" + } + ], + [ + "index", + "wf_service_calls_caller_instance_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_caller_instance_idx ON public.workflow_service_calls USING btree (caller_workflow_instance_id)" + } + ], + [ + "index", + "wf_service_calls_caller_namespace_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_caller_namespace_idx ON public.workflow_service_calls USING btree (caller_namespace)" + } + ], + [ + "index", + "wf_service_calls_caller_outcome_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_caller_outcome_idx ON public.workflow_service_calls USING btree (caller_namespace, outcome)" + } + ], + [ + "index", + "wf_service_calls_caller_run_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_caller_run_idx ON public.workflow_service_calls USING btree (caller_workflow_run_id)" + } + ], + [ + "index", + "wf_service_calls_caller_status_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_caller_status_idx ON public.workflow_service_calls USING btree (caller_namespace, status)" + } + ], + [ + "index", + "wf_service_calls_endpoint_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_endpoint_idx ON public.workflow_service_calls USING btree (workflow_service_endpoint_id)" + } + ], + [ + "index", + "wf_service_calls_idempotency_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_idempotency_idx ON public.workflow_service_calls USING btree (idempotency_key)" + } + ], + [ + "index", + "wf_service_calls_linked_instance_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_linked_instance_idx ON public.workflow_service_calls USING btree (linked_workflow_instance_id)" + } + ], + [ + "index", + "wf_service_calls_linked_run_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_linked_run_idx ON public.workflow_service_calls USING btree (linked_workflow_run_id)" + } + ], + [ + "index", + "wf_service_calls_linked_update_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_linked_update_idx ON public.workflow_service_calls USING btree (linked_workflow_update_id)" + } + ], + [ + "index", + "wf_service_calls_mode_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_mode_idx ON public.workflow_service_calls USING btree (operation_mode)" + } + ], + [ + "index", + "wf_service_calls_namespace_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_namespace_idx ON public.workflow_service_calls USING btree (namespace)" + } + ], + [ + "index", + "wf_service_calls_namespace_outcome_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_namespace_outcome_idx ON public.workflow_service_calls USING btree (namespace, outcome)" + } + ], + [ + "index", + "wf_service_calls_namespace_status_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_namespace_status_idx ON public.workflow_service_calls USING btree (namespace, status)" + } + ], + [ + "index", + "wf_service_calls_operation_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_operation_idx ON public.workflow_service_calls USING btree (workflow_service_operation_id)" + } + ], + [ + "index", + "wf_service_calls_outcome_category_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_outcome_category_idx ON public.workflow_service_calls USING btree (outcome_category)" + } + ], + [ + "index", + "wf_service_calls_outcome_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_outcome_idx ON public.workflow_service_calls USING btree (outcome)" + } + ], + [ + "index", + "wf_service_calls_policy_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_policy_idx ON public.workflow_service_calls USING btree (policy_name)" + } + ], + [ + "index", + "wf_service_calls_principal_subject_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_principal_subject_idx ON public.workflow_service_calls USING btree (caller_principal_subject)" + } + ], + [ + "index", + "wf_service_calls_service_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_service_idx ON public.workflow_service_calls USING btree (workflow_service_id)" + } + ], + [ + "index", + "wf_service_calls_status_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_status_idx ON public.workflow_service_calls USING btree (status)" + } + ], + [ + "index", + "wf_service_calls_target_namespace_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_target_namespace_idx ON public.workflow_service_calls USING btree (target_namespace)" + } + ], + [ + "index", + "wf_service_calls_target_outcome_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_target_outcome_idx ON public.workflow_service_calls USING btree (target_namespace, outcome)" + } + ], + [ + "index", + "wf_service_calls_target_status_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_calls_target_status_idx ON public.workflow_service_calls USING btree (target_namespace, status)" + } + ], + [ + "index", + "wf_service_endpoints_name_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_endpoints_name_idx ON public.workflow_service_endpoints USING btree (endpoint_name)" + } + ], + [ + "index", + "wf_service_endpoints_namespace_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_endpoints_namespace_idx ON public.workflow_service_endpoints USING btree (namespace)" + } + ], + [ + "index", + "wf_service_endpoints_namespace_name_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_service_endpoints_namespace_name_unique ON public.workflow_service_endpoints USING btree (namespace, endpoint_name)" + } + ], + [ + "index", + "wf_service_ops_binding_kind_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_ops_binding_kind_idx ON public.workflow_service_operations USING btree (handler_binding_kind)" + } + ], + [ + "index", + "wf_service_ops_endpoint_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_ops_endpoint_idx ON public.workflow_service_operations USING btree (workflow_service_endpoint_id)" + } + ], + [ + "index", + "wf_service_ops_mode_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_ops_mode_idx ON public.workflow_service_operations USING btree (operation_mode)" + } + ], + [ + "index", + "wf_service_ops_name_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_ops_name_idx ON public.workflow_service_operations USING btree (operation_name)" + } + ], + [ + "index", + "wf_service_ops_namespace_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_ops_namespace_idx ON public.workflow_service_operations USING btree (namespace)" + } + ], + [ + "index", + "wf_service_ops_namespace_name_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_ops_namespace_name_idx ON public.workflow_service_operations USING btree (namespace, operation_name)" + } + ], + [ + "index", + "wf_service_ops_namespace_service_name_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_service_ops_namespace_service_name_unique ON public.workflow_service_operations USING btree (namespace, workflow_service_id, operation_name)" + } + ], + [ + "index", + "wf_service_ops_service_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_service_ops_service_idx ON public.workflow_service_operations USING btree (workflow_service_id)" + } + ], + [ + "index", + "wf_services_endpoint_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_services_endpoint_idx ON public.workflow_services USING btree (workflow_service_endpoint_id)" + } + ], + [ + "index", + "wf_services_name_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_services_name_idx ON public.workflow_services USING btree (service_name)" + } + ], + [ + "index", + "wf_services_namespace_endpoint_name_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX wf_services_namespace_endpoint_name_unique ON public.workflow_services USING btree (namespace, workflow_service_endpoint_id, service_name)" + } + ], + [ + "index", + "wf_services_namespace_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_services_namespace_idx ON public.workflow_services USING btree (namespace)" + } + ], + [ + "index", + "wf_services_namespace_name_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wf_services_namespace_name_idx ON public.workflow_services USING btree (namespace, service_name)" + } + ], + [ + "index", + "wfrs_decl_contract_source_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wfrs_decl_contract_source_idx ON public.workflow_run_summaries USING btree (declared_contract_source)" + } + ], + [ + "index", + "wfrs_decl_entry_mode_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wfrs_decl_entry_mode_idx ON public.workflow_run_summaries USING btree (declared_entry_mode)" + } + ], + [ + "index", + "wfrs_namespace_sort_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wfrs_namespace_sort_idx ON public.workflow_run_summaries USING btree (namespace, sort_timestamp, id)" + } + ], + [ + "index", + "wfrs_namespace_status_sort_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wfrs_namespace_status_sort_idx ON public.workflow_run_summaries USING btree (namespace, status_bucket, sort_timestamp, id)" + } + ], + [ + "index", + "wfrs_namespace_type_sort_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wfrs_namespace_type_sort_idx ON public.workflow_run_summaries USING btree (namespace, workflow_type, sort_timestamp, id)" + } + ], + [ + "index", + "wfrs_prom_metrics_series_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX wfrs_prom_metrics_series_idx ON public.workflow_run_summaries USING btree (namespace, queue, workflow_type)" + } + ], + [ + "index", + "workflow_build_id_rollouts_scope_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_build_id_rollouts_scope_unique ON public.workflow_worker_build_id_rollouts USING btree (namespace, task_queue, build_id)" + } + ], + [ + "index", + "workflow_child_calls_parent_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_child_calls_parent_workflow_instance_id_index ON public.workflow_child_calls USING btree (parent_workflow_instance_id)" + } + ], + [ + "index", + "workflow_child_calls_parent_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_child_calls_parent_workflow_run_id_index ON public.workflow_child_calls USING btree (parent_workflow_run_id)" + } + ], + [ + "index", + "workflow_child_calls_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_child_calls_pkey ON public.workflow_child_calls USING btree (id)" + } + ], + [ + "index", + "workflow_child_calls_resolved_child_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_child_calls_resolved_child_instance_id_index ON public.workflow_child_calls USING btree (resolved_child_instance_id)" + } + ], + [ + "index", + "workflow_child_calls_resolved_child_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_child_calls_resolved_child_run_id_index ON public.workflow_child_calls USING btree (resolved_child_run_id)" + } + ], + [ + "index", + "workflow_child_calls_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_child_calls_sequence_index ON public.workflow_child_calls USING btree (sequence)" + } + ], + [ + "index", + "workflow_child_calls_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_child_calls_status_index ON public.workflow_child_calls USING btree (status)" + } + ], + [ + "index", + "workflow_child_projection_repairs_drain_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_child_projection_repairs_drain_idx ON public.workflow_child_projection_repairs USING btree (workflow_run_id, workflow_task_id, history_sequence)" + } + ], + [ + "index", + "workflow_child_projection_repairs_failure_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_child_projection_repairs_failure_idx ON public.workflow_child_projection_repairs USING btree (workflow_run_id, failure_id)" + } + ], + [ + "index", + "workflow_child_projection_repairs_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_child_projection_repairs_pkey ON public.workflow_child_projection_repairs USING btree (workflow_history_event_id)" + } + ], + [ + "index", + "workflow_commands_command_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_commands_command_sequence_index ON public.workflow_commands USING btree (command_sequence)" + } + ], + [ + "index", + "workflow_commands_command_type_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_commands_command_type_index ON public.workflow_commands USING btree (command_type)" + } + ], + [ + "index", + "workflow_commands_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_commands_pkey ON public.workflow_commands USING btree (id)" + } + ], + [ + "index", + "workflow_commands_request_lookup", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_commands_request_lookup ON public.workflow_commands USING btree (workflow_instance_id, command_type, request_id)" + } + ], + [ + "index", + "workflow_commands_requested_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_commands_requested_workflow_run_id_index ON public.workflow_commands USING btree (requested_workflow_run_id)" + } + ], + [ + "index", + "workflow_commands_resolved_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_commands_resolved_workflow_run_id_index ON public.workflow_commands USING btree (resolved_workflow_run_id)" + } + ], + [ + "index", + "workflow_commands_source_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_commands_source_index ON public.workflow_commands USING btree (source)" + } + ], + [ + "index", + "workflow_commands_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_commands_status_index ON public.workflow_commands USING btree (status)" + } + ], + [ + "index", + "workflow_commands_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_commands_workflow_instance_id_index ON public.workflow_commands USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_commands_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_commands_workflow_run_id_index ON public.workflow_commands USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_durable_stream_items_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_durable_stream_items_namespace_index ON public.workflow_durable_stream_items USING btree (namespace)" + } + ], + [ + "index", + "workflow_durable_stream_items_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_durable_stream_items_pkey ON public.workflow_durable_stream_items USING btree (id)" + } + ], + [ + "index", + "workflow_durable_stream_items_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_durable_stream_items_workflow_run_id_index ON public.workflow_durable_stream_items USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_durable_streams_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_durable_streams_namespace_index ON public.workflow_durable_streams USING btree (namespace)" + } + ], + [ + "index", + "workflow_durable_streams_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_durable_streams_pkey ON public.workflow_durable_streams USING btree (id)" + } + ], + [ + "index", + "workflow_durable_streams_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_durable_streams_status_index ON public.workflow_durable_streams USING btree (status)" + } + ], + [ + "index", + "workflow_durable_streams_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_durable_streams_workflow_instance_id_index ON public.workflow_durable_streams USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_durable_streams_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_durable_streams_workflow_run_id_index ON public.workflow_durable_streams USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_failures_failure_category_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_failures_failure_category_index ON public.workflow_failures USING btree (failure_category)" + } + ], + [ + "index", + "workflow_failures_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_failures_pkey ON public.workflow_failures USING btree (id)" + } + ], + [ + "index", + "workflow_failures_source_kind_source_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_failures_source_kind_source_id_index ON public.workflow_failures USING btree (source_kind, source_id)" + } + ], + [ + "index", + "workflow_failures_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_failures_workflow_run_id_index ON public.workflow_failures USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_history_events_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_history_events_pkey ON public.workflow_history_events USING btree (id)" + } + ], + [ + "index", + "workflow_history_events_workflow_command_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_history_events_workflow_command_id_index ON public.workflow_history_events USING btree (workflow_command_id)" + } + ], + [ + "index", + "workflow_history_events_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_history_events_workflow_run_id_index ON public.workflow_history_events USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_history_events_workflow_run_id_sequence_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_history_events_workflow_run_id_sequence_unique ON public.workflow_history_events USING btree (workflow_run_id, sequence)" + } + ], + [ + "index", + "workflow_history_events_workflow_task_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_history_events_workflow_task_id_index ON public.workflow_history_events USING btree (workflow_task_id)" + } + ], + [ + "index", + "workflow_inbound_stream_items_consumed_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_stream_items_consumed_run_id_index ON public.workflow_inbound_stream_items USING btree (consumed_run_id)" + } + ], + [ + "index", + "workflow_inbound_stream_items_consumed_task_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_stream_items_consumed_task_id_index ON public.workflow_inbound_stream_items USING btree (consumed_task_id)" + } + ], + [ + "index", + "workflow_inbound_stream_items_delivered_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_stream_items_delivered_run_id_index ON public.workflow_inbound_stream_items USING btree (delivered_run_id)" + } + ], + [ + "index", + "workflow_inbound_stream_items_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_stream_items_namespace_index ON public.workflow_inbound_stream_items USING btree (namespace)" + } + ], + [ + "index", + "workflow_inbound_stream_items_payload_released_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_stream_items_payload_released_at_index ON public.workflow_inbound_stream_items USING btree (payload_released_at)" + } + ], + [ + "index", + "workflow_inbound_stream_items_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_inbound_stream_items_pkey ON public.workflow_inbound_stream_items USING btree (id)" + } + ], + [ + "index", + "workflow_inbound_stream_items_workflow_command_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_stream_items_workflow_command_id_index ON public.workflow_inbound_stream_items USING btree (workflow_command_id)" + } + ], + [ + "index", + "workflow_inbound_stream_items_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_stream_items_workflow_instance_id_index ON public.workflow_inbound_stream_items USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_inbound_streams_cleanup_blocked_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_streams_cleanup_blocked_run_id_index ON public.workflow_inbound_streams USING btree (cleanup_blocked_run_id)" + } + ], + [ + "index", + "workflow_inbound_streams_cursor_checkpoint_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_streams_cursor_checkpoint_run_id_index ON public.workflow_inbound_streams USING btree (cursor_checkpoint_run_id)" + } + ], + [ + "index", + "workflow_inbound_streams_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_streams_namespace_index ON public.workflow_inbound_streams USING btree (namespace)" + } + ], + [ + "index", + "workflow_inbound_streams_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_inbound_streams_pkey ON public.workflow_inbound_streams USING btree (id)" + } + ], + [ + "index", + "workflow_inbound_streams_waiting_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_streams_waiting_run_id_index ON public.workflow_inbound_streams USING btree (waiting_run_id)" + } + ], + [ + "index", + "workflow_inbound_streams_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_inbound_streams_workflow_instance_id_index ON public.workflow_inbound_streams USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_instances_business_key_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_instances_business_key_index ON public.workflow_instances USING btree (business_key)" + } + ], + [ + "index", + "workflow_instances_current_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_instances_current_run_id_index ON public.workflow_instances USING btree (current_run_id)" + } + ], + [ + "index", + "workflow_instances_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_instances_namespace_index ON public.workflow_instances USING btree (namespace)" + } + ], + [ + "index", + "workflow_instances_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_instances_pkey ON public.workflow_instances USING btree (id)" + } + ], + [ + "index", + "workflow_links_child_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_links_child_workflow_instance_id_index ON public.workflow_links USING btree (child_workflow_instance_id)" + } + ], + [ + "index", + "workflow_links_child_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_links_child_workflow_run_id_index ON public.workflow_links USING btree (child_workflow_run_id)" + } + ], + [ + "index", + "workflow_links_parent_child_type_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_links_parent_child_type_unique ON public.workflow_links USING btree (parent_workflow_run_id, child_workflow_run_id, link_type)" + } + ], + [ + "index", + "workflow_links_parent_sequence_type_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_links_parent_sequence_type_index ON public.workflow_links USING btree (parent_workflow_run_id, sequence, link_type)" + } + ], + [ + "index", + "workflow_links_parent_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_links_parent_workflow_instance_id_index ON public.workflow_links USING btree (parent_workflow_instance_id)" + } + ], + [ + "index", + "workflow_links_parent_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_links_parent_workflow_run_id_index ON public.workflow_links USING btree (parent_workflow_run_id)" + } + ], + [ + "index", + "workflow_links_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_links_pkey ON public.workflow_links USING btree (id)" + } + ], + [ + "index", + "workflow_memos_instance_key", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_memos_instance_key ON public.workflow_memos USING btree (workflow_instance_id, key)" + } + ], + [ + "index", + "workflow_memos_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_memos_pkey ON public.workflow_memos USING btree (id)" + } + ], + [ + "index", + "workflow_memos_run_key_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_memos_run_key_unique ON public.workflow_memos USING btree (workflow_run_id, key)" + } + ], + [ + "index", + "workflow_messages_channel_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_channel_index ON public.workflow_messages USING btree (channel)" + } + ], + [ + "index", + "workflow_messages_consume_state_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_consume_state_index ON public.workflow_messages USING btree (consume_state)" + } + ], + [ + "index", + "workflow_messages_correlation_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_correlation_id_index ON public.workflow_messages USING btree (correlation_id)" + } + ], + [ + "index", + "workflow_messages_direction_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_direction_index ON public.workflow_messages USING btree (direction)" + } + ], + [ + "index", + "workflow_messages_idempotency_key_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_idempotency_key_index ON public.workflow_messages USING btree (idempotency_key)" + } + ], + [ + "index", + "workflow_messages_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_messages_pkey ON public.workflow_messages USING btree (id)" + } + ], + [ + "index", + "workflow_messages_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_sequence_index ON public.workflow_messages USING btree (sequence)" + } + ], + [ + "index", + "workflow_messages_source_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_source_workflow_instance_id_index ON public.workflow_messages USING btree (source_workflow_instance_id)" + } + ], + [ + "index", + "workflow_messages_stream_key_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_stream_key_index ON public.workflow_messages USING btree (stream_key)" + } + ], + [ + "index", + "workflow_messages_target_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_target_workflow_instance_id_index ON public.workflow_messages USING btree (target_workflow_instance_id)" + } + ], + [ + "index", + "workflow_messages_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_workflow_instance_id_index ON public.workflow_messages USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_messages_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_messages_workflow_run_id_index ON public.workflow_messages USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_namespaces_name_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_namespaces_name_unique ON public.workflow_namespaces USING btree (name)" + } + ], + [ + "index", + "workflow_namespaces_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_namespaces_pkey ON public.workflow_namespaces USING btree (id)" + } + ], + [ + "index", + "workflow_run_lineage_entries_child_call_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_child_call_id_index ON public.workflow_run_lineage_entries USING btree (child_call_id)" + } + ], + [ + "index", + "workflow_run_lineage_entries_closed_reason_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_closed_reason_index ON public.workflow_run_lineage_entries USING btree (closed_reason)" + } + ], + [ + "index", + "workflow_run_lineage_entries_direction_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_direction_index ON public.workflow_run_lineage_entries USING btree (direction)" + } + ], + [ + "index", + "workflow_run_lineage_entries_is_primary_parent_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_is_primary_parent_index ON public.workflow_run_lineage_entries USING btree (is_primary_parent)" + } + ], + [ + "index", + "workflow_run_lineage_entries_link_type_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_link_type_index ON public.workflow_run_lineage_entries USING btree (link_type)" + } + ], + [ + "index", + "workflow_run_lineage_entries_linked_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_linked_at_index ON public.workflow_run_lineage_entries USING btree (linked_at)" + } + ], + [ + "index", + "workflow_run_lineage_entries_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_run_lineage_entries_pkey ON public.workflow_run_lineage_entries USING btree (id)" + } + ], + [ + "index", + "workflow_run_lineage_entries_related_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_related_workflow_instance_id_index ON public.workflow_run_lineage_entries USING btree (related_workflow_instance_id)" + } + ], + [ + "index", + "workflow_run_lineage_entries_related_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_related_workflow_run_id_index ON public.workflow_run_lineage_entries USING btree (related_workflow_run_id)" + } + ], + [ + "index", + "workflow_run_lineage_entries_related_workflow_type_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_related_workflow_type_index ON public.workflow_run_lineage_entries USING btree (related_workflow_type)" + } + ], + [ + "index", + "workflow_run_lineage_entries_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_sequence_index ON public.workflow_run_lineage_entries USING btree (sequence)" + } + ], + [ + "index", + "workflow_run_lineage_entries_status_bucket_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_status_bucket_index ON public.workflow_run_lineage_entries USING btree (status_bucket)" + } + ], + [ + "index", + "workflow_run_lineage_entries_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_status_index ON public.workflow_run_lineage_entries USING btree (status)" + } + ], + [ + "index", + "workflow_run_lineage_entries_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_workflow_instance_id_index ON public.workflow_run_lineage_entries USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_run_lineage_entries_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_entries_workflow_run_id_index ON public.workflow_run_lineage_entries USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_run_lineage_instance_direction_type_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_instance_direction_type_index ON public.workflow_run_lineage_entries USING btree (workflow_instance_id, direction, link_type)" + } + ], + [ + "index", + "workflow_run_lineage_run_direction_lineage_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_run_lineage_run_direction_lineage_unique ON public.workflow_run_lineage_entries USING btree (workflow_run_id, direction, lineage_id)" + } + ], + [ + "index", + "workflow_run_lineage_run_direction_position_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_lineage_run_direction_position_index ON public.workflow_run_lineage_entries USING btree (workflow_run_id, direction, \"position\")" + } + ], + [ + "index", + "workflow_run_summaries_archive_command_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_archive_command_id_index ON public.workflow_run_summaries USING btree (archive_command_id)" + } + ], + [ + "index", + "workflow_run_summaries_archived_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_archived_at_index ON public.workflow_run_summaries USING btree (archived_at)" + } + ], + [ + "index", + "workflow_run_summaries_business_key_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_business_key_index ON public.workflow_run_summaries USING btree (business_key)" + } + ], + [ + "index", + "workflow_run_summaries_continue_as_new_recommended_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_continue_as_new_recommended_index ON public.workflow_run_summaries USING btree (continue_as_new_recommended)" + } + ], + [ + "index", + "workflow_run_summaries_history_budget_pressure_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_history_budget_pressure_index ON public.workflow_run_summaries USING btree (history_budget_pressure)" + } + ], + [ + "index", + "workflow_run_summaries_is_current_run_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_is_current_run_index ON public.workflow_run_summaries USING btree (is_current_run)" + } + ], + [ + "index", + "workflow_run_summaries_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_namespace_index ON public.workflow_run_summaries USING btree (namespace)" + } + ], + [ + "index", + "workflow_run_summaries_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_run_summaries_pkey ON public.workflow_run_summaries USING btree (id)" + } + ], + [ + "index", + "workflow_run_summaries_projection_schema_version_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_projection_schema_version_index ON public.workflow_run_summaries USING btree (projection_schema_version)" + } + ], + [ + "index", + "workflow_run_summaries_repair_attention_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_repair_attention_index ON public.workflow_run_summaries USING btree (repair_attention)" + } + ], + [ + "index", + "workflow_run_summaries_repair_blocked_reason_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_repair_blocked_reason_index ON public.workflow_run_summaries USING btree (repair_blocked_reason)" + } + ], + [ + "index", + "workflow_run_summaries_sort_key_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_sort_key_index ON public.workflow_run_summaries USING btree (sort_key)" + } + ], + [ + "index", + "workflow_run_summaries_sort_order_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_sort_order_index ON public.workflow_run_summaries USING btree (sort_timestamp, id)" + } + ], + [ + "index", + "workflow_run_summaries_status_bucket_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_status_bucket_index ON public.workflow_run_summaries USING btree (status_bucket)" + } + ], + [ + "index", + "workflow_run_summaries_status_bucket_started_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_status_bucket_started_at_index ON public.workflow_run_summaries USING btree (status_bucket, started_at)" + } + ], + [ + "index", + "workflow_run_summaries_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_status_index ON public.workflow_run_summaries USING btree (status)" + } + ], + [ + "index", + "workflow_run_summaries_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_summaries_workflow_instance_id_index ON public.workflow_run_summaries USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_run_timeline_entries_activity_execution_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_activity_execution_id_index ON public.workflow_run_timeline_entries USING btree (activity_execution_id)" + } + ], + [ + "index", + "workflow_run_timeline_entries_command_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_command_id_index ON public.workflow_run_timeline_entries USING btree (command_id)" + } + ], + [ + "index", + "workflow_run_timeline_entries_command_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_command_sequence_index ON public.workflow_run_timeline_entries USING btree (command_sequence)" + } + ], + [ + "index", + "workflow_run_timeline_entries_failure_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_failure_id_index ON public.workflow_run_timeline_entries USING btree (failure_id)" + } + ], + [ + "index", + "workflow_run_timeline_entries_history_event_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_history_event_id_index ON public.workflow_run_timeline_entries USING btree (history_event_id)" + } + ], + [ + "index", + "workflow_run_timeline_entries_kind_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_kind_index ON public.workflow_run_timeline_entries USING btree (kind)" + } + ], + [ + "index", + "workflow_run_timeline_entries_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_run_timeline_entries_pkey ON public.workflow_run_timeline_entries USING btree (id)" + } + ], + [ + "index", + "workflow_run_timeline_entries_recorded_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_recorded_at_index ON public.workflow_run_timeline_entries USING btree (recorded_at)" + } + ], + [ + "index", + "workflow_run_timeline_entries_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_sequence_index ON public.workflow_run_timeline_entries USING btree (sequence)" + } + ], + [ + "index", + "workflow_run_timeline_entries_source_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_source_id_index ON public.workflow_run_timeline_entries USING btree (source_id)" + } + ], + [ + "index", + "workflow_run_timeline_entries_source_kind_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_source_kind_index ON public.workflow_run_timeline_entries USING btree (source_kind)" + } + ], + [ + "index", + "workflow_run_timeline_entries_task_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_task_id_index ON public.workflow_run_timeline_entries USING btree (task_id)" + } + ], + [ + "index", + "workflow_run_timeline_entries_timer_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_timer_id_index ON public.workflow_run_timeline_entries USING btree (timer_id)" + } + ], + [ + "index", + "workflow_run_timeline_entries_type_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_type_index ON public.workflow_run_timeline_entries USING btree (type)" + } + ], + [ + "index", + "workflow_run_timeline_entries_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_workflow_instance_id_index ON public.workflow_run_timeline_entries USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_run_timeline_entries_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_entries_workflow_run_id_index ON public.workflow_run_timeline_entries USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_run_timeline_instance_kind_recorded_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_instance_kind_recorded_index ON public.workflow_run_timeline_entries USING btree (workflow_instance_id, kind, recorded_at)" + } + ], + [ + "index", + "workflow_run_timeline_run_event_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_run_timeline_run_event_unique ON public.workflow_run_timeline_entries USING btree (workflow_run_id, history_event_id)" + } + ], + [ + "index", + "workflow_run_timeline_run_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timeline_run_sequence_index ON public.workflow_run_timeline_entries USING btree (workflow_run_id, sequence)" + } + ], + [ + "index", + "workflow_run_timer_entries_condition_key_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_condition_key_index ON public.workflow_run_timer_entries USING btree (condition_key)" + } + ], + [ + "index", + "workflow_run_timer_entries_condition_wait_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_condition_wait_id_index ON public.workflow_run_timer_entries USING btree (condition_wait_id)" + } + ], + [ + "index", + "workflow_run_timer_entries_history_authority_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_history_authority_index ON public.workflow_run_timer_entries USING btree (history_authority)" + } + ], + [ + "index", + "workflow_run_timer_entries_instance_kind_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_instance_kind_status_index ON public.workflow_run_timer_entries USING btree (workflow_instance_id, timer_kind, status)" + } + ], + [ + "index", + "workflow_run_timer_entries_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_run_timer_entries_pkey ON public.workflow_run_timer_entries USING btree (id)" + } + ], + [ + "index", + "workflow_run_timer_entries_run_status_position_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_run_status_position_index ON public.workflow_run_timer_entries USING btree (workflow_run_id, status, \"position\")" + } + ], + [ + "index", + "workflow_run_timer_entries_run_timer_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_run_timer_entries_run_timer_unique ON public.workflow_run_timer_entries USING btree (workflow_run_id, timer_id)" + } + ], + [ + "index", + "workflow_run_timer_entries_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_sequence_index ON public.workflow_run_timer_entries USING btree (sequence)" + } + ], + [ + "index", + "workflow_run_timer_entries_source_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_source_status_index ON public.workflow_run_timer_entries USING btree (source_status)" + } + ], + [ + "index", + "workflow_run_timer_entries_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_status_index ON public.workflow_run_timer_entries USING btree (status)" + } + ], + [ + "index", + "workflow_run_timer_entries_timer_kind_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_timer_kind_index ON public.workflow_run_timer_entries USING btree (timer_kind)" + } + ], + [ + "index", + "workflow_run_timer_entries_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_workflow_instance_id_index ON public.workflow_run_timer_entries USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_run_timer_entries_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timer_entries_workflow_run_id_index ON public.workflow_run_timer_entries USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_run_timers_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_run_timers_pkey ON public.workflow_run_timers USING btree (id)" + } + ], + [ + "index", + "workflow_run_timers_status_fire_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timers_status_fire_at_index ON public.workflow_run_timers USING btree (status, fire_at)" + } + ], + [ + "index", + "workflow_run_timers_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_timers_workflow_run_id_index ON public.workflow_run_timers USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_run_timers_workflow_run_id_sequence_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_run_timers_workflow_run_id_sequence_unique ON public.workflow_run_timers USING btree (workflow_run_id, sequence)" + } + ], + [ + "index", + "workflow_run_waits_command_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_command_id_index ON public.workflow_run_waits USING btree (command_id)" + } + ], + [ + "index", + "workflow_run_waits_history_authority_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_history_authority_index ON public.workflow_run_waits USING btree (history_authority)" + } + ], + [ + "index", + "workflow_run_waits_instance_kind_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_instance_kind_status_index ON public.workflow_run_waits USING btree (workflow_instance_id, kind, status)" + } + ], + [ + "index", + "workflow_run_waits_kind_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_kind_index ON public.workflow_run_waits USING btree (kind)" + } + ], + [ + "index", + "workflow_run_waits_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_run_waits_pkey ON public.workflow_run_waits USING btree (id)" + } + ], + [ + "index", + "workflow_run_waits_resume_source_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_resume_source_id_index ON public.workflow_run_waits USING btree (resume_source_id)" + } + ], + [ + "index", + "workflow_run_waits_resume_source_kind_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_resume_source_kind_index ON public.workflow_run_waits USING btree (resume_source_kind)" + } + ], + [ + "index", + "workflow_run_waits_run_status_position_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_run_status_position_index ON public.workflow_run_waits USING btree (workflow_run_id, status, \"position\")" + } + ], + [ + "index", + "workflow_run_waits_run_wait_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_run_waits_run_wait_unique ON public.workflow_run_waits USING btree (workflow_run_id, wait_id)" + } + ], + [ + "index", + "workflow_run_waits_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_sequence_index ON public.workflow_run_waits USING btree (sequence)" + } + ], + [ + "index", + "workflow_run_waits_source_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_source_status_index ON public.workflow_run_waits USING btree (source_status)" + } + ], + [ + "index", + "workflow_run_waits_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_status_index ON public.workflow_run_waits USING btree (status)" + } + ], + [ + "index", + "workflow_run_waits_target_name_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_target_name_index ON public.workflow_run_waits USING btree (target_name)" + } + ], + [ + "index", + "workflow_run_waits_task_backed_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_task_backed_index ON public.workflow_run_waits USING btree (task_backed)" + } + ], + [ + "index", + "workflow_run_waits_task_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_task_id_index ON public.workflow_run_waits USING btree (task_id)" + } + ], + [ + "index", + "workflow_run_waits_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_workflow_instance_id_index ON public.workflow_run_waits USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_run_waits_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_run_waits_workflow_run_id_index ON public.workflow_run_waits USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_runs_archive_command_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_archive_command_id_index ON public.workflow_runs USING btree (archive_command_id)" + } + ], + [ + "index", + "workflow_runs_archived_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_archived_at_index ON public.workflow_runs USING btree (archived_at)" + } + ], + [ + "index", + "workflow_runs_business_key_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_business_key_index ON public.workflow_runs USING btree (business_key)" + } + ], + [ + "index", + "workflow_runs_cancellation_request_command_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_cancellation_request_command_id_index ON public.workflow_runs USING btree (cancellation_request_command_id)" + } + ], + [ + "index", + "workflow_runs_import_dedupe_key_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_import_dedupe_key_index ON public.workflow_runs USING btree (import_dedupe_key)" + } + ], + [ + "index", + "workflow_runs_import_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_import_id_index ON public.workflow_runs USING btree (import_id)" + } + ], + [ + "index", + "workflow_runs_import_source_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_import_source_index ON public.workflow_runs USING btree (import_source)" + } + ], + [ + "index", + "workflow_runs_imported_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_imported_at_index ON public.workflow_runs USING btree (imported_at)" + } + ], + [ + "index", + "workflow_runs_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_namespace_index ON public.workflow_runs USING btree (namespace)" + } + ], + [ + "index", + "workflow_runs_namespace_status_quota_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_namespace_status_quota_idx ON public.workflow_runs USING btree (namespace, status)" + } + ], + [ + "index", + "workflow_runs_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_runs_pkey ON public.workflow_runs USING btree (id)" + } + ], + [ + "index", + "workflow_runs_prom_metrics_queue_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_prom_metrics_queue_idx ON public.workflow_runs USING btree (namespace, queue)" + } + ], + [ + "index", + "workflow_runs_sticky_until_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_sticky_until_index ON public.workflow_runs USING btree (sticky_until)" + } + ], + [ + "index", + "workflow_runs_sticky_worker_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_sticky_worker_id_index ON public.workflow_runs USING btree (sticky_worker_id)" + } + ], + [ + "index", + "workflow_runs_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_runs_workflow_instance_id_index ON public.workflow_runs USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_runs_workflow_instance_id_run_number_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_runs_workflow_instance_id_run_number_unique ON public.workflow_runs USING btree (workflow_instance_id, run_number)" + } + ], + [ + "index", + "workflow_schedule_history_events_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_schedule_history_events_pkey ON public.workflow_schedule_history_events USING btree (id)" + } + ], + [ + "index", + "workflow_schedules_latest_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_schedules_latest_workflow_instance_id_index ON public.workflow_schedules USING btree (latest_workflow_instance_id)" + } + ], + [ + "index", + "workflow_schedules_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_schedules_namespace_index ON public.workflow_schedules USING btree (namespace)" + } + ], + [ + "index", + "workflow_schedules_namespace_schedule_id_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_schedules_namespace_schedule_id_unique ON public.workflow_schedules USING btree (namespace, schedule_id)" + } + ], + [ + "index", + "workflow_schedules_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_schedules_pkey ON public.workflow_schedules USING btree (id)" + } + ], + [ + "index", + "workflow_schedules_status_next_fire_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_schedules_status_next_fire_at_index ON public.workflow_schedules USING btree (status, next_fire_at)" + } + ], + [ + "index", + "workflow_search_attributes_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_search_attributes_pkey ON public.workflow_search_attributes USING btree (id)" + } + ], + [ + "index", + "workflow_search_attributes_value_bool_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attributes_value_bool_index ON public.workflow_search_attributes USING btree (value_bool)" + } + ], + [ + "index", + "workflow_search_attributes_value_datetime_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attributes_value_datetime_index ON public.workflow_search_attributes USING btree (value_datetime)" + } + ], + [ + "index", + "workflow_search_attributes_value_float_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attributes_value_float_index ON public.workflow_search_attributes USING btree (value_float)" + } + ], + [ + "index", + "workflow_search_attributes_value_int_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attributes_value_int_index ON public.workflow_search_attributes USING btree (value_int)" + } + ], + [ + "index", + "workflow_search_attributes_value_keyword_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attributes_value_keyword_index ON public.workflow_search_attributes USING btree (value_keyword)" + } + ], + [ + "index", + "workflow_search_attributes_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attributes_workflow_instance_id_index ON public.workflow_search_attributes USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_search_attributes_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attributes_workflow_run_id_index ON public.workflow_search_attributes USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_search_attrs_instance_key_type", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attrs_instance_key_type ON public.workflow_search_attributes USING btree (workflow_instance_id, key, type)" + } + ], + [ + "index", + "workflow_search_attrs_key_bool", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attrs_key_bool ON public.workflow_search_attributes USING btree (key, value_bool)" + } + ], + [ + "index", + "workflow_search_attrs_key_datetime", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attrs_key_datetime ON public.workflow_search_attributes USING btree (key, value_datetime)" + } + ], + [ + "index", + "workflow_search_attrs_key_float", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attrs_key_float ON public.workflow_search_attributes USING btree (key, value_float)" + } + ], + [ + "index", + "workflow_search_attrs_key_int", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attrs_key_int ON public.workflow_search_attributes USING btree (key, value_int)" + } + ], + [ + "index", + "workflow_search_attrs_key_keyword", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_search_attrs_key_keyword ON public.workflow_search_attributes USING btree (key, value_keyword)" + } + ], + [ + "index", + "workflow_search_attrs_run_key_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_search_attrs_run_key_unique ON public.workflow_search_attributes USING btree (workflow_run_id, key)" + } + ], + [ + "index", + "workflow_service_calls_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_service_calls_pkey ON public.workflow_service_calls USING btree (id)" + } + ], + [ + "index", + "workflow_service_endpoints_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_service_endpoints_pkey ON public.workflow_service_endpoints USING btree (id)" + } + ], + [ + "index", + "workflow_service_operations_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_service_operations_pkey ON public.workflow_service_operations USING btree (id)" + } + ], + [ + "index", + "workflow_services_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_services_pkey ON public.workflow_services USING btree (id)" + } + ], + [ + "index", + "workflow_signal_records_command_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_signal_records_command_sequence_index ON public.workflow_signal_records USING btree (command_sequence)" + } + ], + [ + "index", + "workflow_signal_records_outcome_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_signal_records_outcome_index ON public.workflow_signal_records USING btree (outcome)" + } + ], + [ + "index", + "workflow_signal_records_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_signal_records_pkey ON public.workflow_signal_records USING btree (id)" + } + ], + [ + "index", + "workflow_signal_records_requested_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_signal_records_requested_workflow_run_id_index ON public.workflow_signal_records USING btree (requested_workflow_run_id)" + } + ], + [ + "index", + "workflow_signal_records_resolved_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_signal_records_resolved_workflow_run_id_index ON public.workflow_signal_records USING btree (resolved_workflow_run_id)" + } + ], + [ + "index", + "workflow_signal_records_signal_name_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_signal_records_signal_name_index ON public.workflow_signal_records USING btree (signal_name)" + } + ], + [ + "index", + "workflow_signal_records_signal_wait_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_signal_records_signal_wait_id_index ON public.workflow_signal_records USING btree (signal_wait_id)" + } + ], + [ + "index", + "workflow_signal_records_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_signal_records_status_index ON public.workflow_signal_records USING btree (status)" + } + ], + [ + "index", + "workflow_signal_records_workflow_command_id_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_signal_records_workflow_command_id_unique ON public.workflow_signal_records USING btree (workflow_command_id)" + } + ], + [ + "index", + "workflow_signal_records_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_signal_records_workflow_instance_id_index ON public.workflow_signal_records USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_signal_records_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_signal_records_workflow_run_id_index ON public.workflow_signal_records USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_signal_records_workflow_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_signal_records_workflow_sequence_index ON public.workflow_signal_records USING btree (workflow_sequence)" + } + ], + [ + "index", + "workflow_task_poll_cursors_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_task_poll_cursors_pkey ON public.workflow_task_poll_cursors USING btree (namespace, task_queue)" + } + ], + [ + "index", + "workflow_tasks_dispatch_order_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_dispatch_order_index ON public.workflow_tasks USING btree (queue, status, priority, available_at)" + } + ], + [ + "index", + "workflow_tasks_fairness_class_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_fairness_class_index ON public.workflow_tasks USING btree (queue, status, fairness_key)" + } + ], + [ + "index", + "workflow_tasks_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_namespace_index ON public.workflow_tasks USING btree (namespace)" + } + ], + [ + "index", + "workflow_tasks_namespace_queue_status_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_namespace_queue_status_idx ON public.workflow_tasks USING btree (namespace, queue, status)" + } + ], + [ + "index", + "workflow_tasks_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_tasks_pkey ON public.workflow_tasks USING btree (id)" + } + ], + [ + "index", + "workflow_tasks_prom_metrics_queue_idx", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_prom_metrics_queue_idx ON public.workflow_tasks USING btree (namespace, queue)" + } + ], + [ + "index", + "workflow_tasks_status_available_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_status_available_at_index ON public.workflow_tasks USING btree (status, available_at)" + } + ], + [ + "index", + "workflow_tasks_sticky_claimed_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_sticky_claimed_at_index ON public.workflow_tasks USING btree (sticky_claimed_at)" + } + ], + [ + "index", + "workflow_tasks_sticky_replay_mode_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_sticky_replay_mode_index ON public.workflow_tasks USING btree (sticky_replay_mode)" + } + ], + [ + "index", + "workflow_tasks_sticky_until_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_sticky_until_index ON public.workflow_tasks USING btree (sticky_until)" + } + ], + [ + "index", + "workflow_tasks_sticky_worker_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_sticky_worker_id_index ON public.workflow_tasks USING btree (sticky_worker_id)" + } + ], + [ + "index", + "workflow_tasks_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_tasks_workflow_run_id_index ON public.workflow_tasks USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_update_validation_poll_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_poll_index ON public.workflow_update_validation_tasks USING btree (namespace, task_queue, status, created_at)" + } + ], + [ + "index", + "workflow_update_validation_tasks_compatibility_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_tasks_compatibility_index ON public.workflow_update_validation_tasks USING btree (compatibility)" + } + ], + [ + "index", + "workflow_update_validation_tasks_idempotency_key_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_update_validation_tasks_idempotency_key_unique ON public.workflow_update_validation_tasks USING btree (idempotency_key)" + } + ], + [ + "index", + "workflow_update_validation_tasks_lease_expires_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_tasks_lease_expires_at_index ON public.workflow_update_validation_tasks USING btree (lease_expires_at)" + } + ], + [ + "index", + "workflow_update_validation_tasks_lease_owner_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_tasks_lease_owner_index ON public.workflow_update_validation_tasks USING btree (lease_owner)" + } + ], + [ + "index", + "workflow_update_validation_tasks_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_tasks_namespace_index ON public.workflow_update_validation_tasks USING btree (namespace)" + } + ], + [ + "index", + "workflow_update_validation_tasks_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_update_validation_tasks_pkey ON public.workflow_update_validation_tasks USING btree (id)" + } + ], + [ + "index", + "workflow_update_validation_tasks_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_tasks_status_index ON public.workflow_update_validation_tasks USING btree (status)" + } + ], + [ + "index", + "workflow_update_validation_tasks_task_queue_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_tasks_task_queue_index ON public.workflow_update_validation_tasks USING btree (task_queue)" + } + ], + [ + "index", + "workflow_update_validation_tasks_update_name_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_tasks_update_name_index ON public.workflow_update_validation_tasks USING btree (update_name)" + } + ], + [ + "index", + "workflow_update_validation_tasks_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_tasks_workflow_instance_id_index ON public.workflow_update_validation_tasks USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_update_validation_tasks_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_tasks_workflow_run_id_index ON public.workflow_update_validation_tasks USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_update_validation_tasks_workflow_type_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_update_validation_tasks_workflow_type_index ON public.workflow_update_validation_tasks USING btree (workflow_type)" + } + ], + [ + "index", + "workflow_updates_command_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_updates_command_sequence_index ON public.workflow_updates USING btree (command_sequence)" + } + ], + [ + "index", + "workflow_updates_failure_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_updates_failure_id_index ON public.workflow_updates USING btree (failure_id)" + } + ], + [ + "index", + "workflow_updates_outcome_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_updates_outcome_index ON public.workflow_updates USING btree (outcome)" + } + ], + [ + "index", + "workflow_updates_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_updates_pkey ON public.workflow_updates USING btree (id)" + } + ], + [ + "index", + "workflow_updates_requested_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_updates_requested_workflow_run_id_index ON public.workflow_updates USING btree (requested_workflow_run_id)" + } + ], + [ + "index", + "workflow_updates_resolved_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_updates_resolved_workflow_run_id_index ON public.workflow_updates USING btree (resolved_workflow_run_id)" + } + ], + [ + "index", + "workflow_updates_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_updates_status_index ON public.workflow_updates USING btree (status)" + } + ], + [ + "index", + "workflow_updates_update_name_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_updates_update_name_index ON public.workflow_updates USING btree (update_name)" + } + ], + [ + "index", + "workflow_updates_workflow_command_id_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_updates_workflow_command_id_unique ON public.workflow_updates USING btree (workflow_command_id)" + } + ], + [ + "index", + "workflow_updates_workflow_instance_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_updates_workflow_instance_id_index ON public.workflow_updates USING btree (workflow_instance_id)" + } + ], + [ + "index", + "workflow_updates_workflow_run_id_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_updates_workflow_run_id_index ON public.workflow_updates USING btree (workflow_run_id)" + } + ], + [ + "index", + "workflow_updates_workflow_sequence_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_updates_workflow_sequence_index ON public.workflow_updates USING btree (workflow_sequence)" + } + ], + [ + "index", + "workflow_worker_build_id_rollouts_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_worker_build_id_rollouts_pkey ON public.workflow_worker_build_id_rollouts USING btree (id)" + } + ], + [ + "index", + "workflow_worker_compatibility_heartbeats_connection_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_worker_compatibility_heartbeats_connection_index ON public.workflow_worker_compatibility_heartbeats USING btree (connection)" + } + ], + [ + "index", + "workflow_worker_compatibility_heartbeats_expires_at_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_worker_compatibility_heartbeats_expires_at_index ON public.workflow_worker_compatibility_heartbeats USING btree (expires_at)" + } + ], + [ + "index", + "workflow_worker_compatibility_heartbeats_namespace_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_worker_compatibility_heartbeats_namespace_index ON public.workflow_worker_compatibility_heartbeats USING btree (namespace)" + } + ], + [ + "index", + "workflow_worker_compatibility_heartbeats_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_worker_compatibility_heartbeats_pkey ON public.workflow_worker_compatibility_heartbeats USING btree (id)" + } + ], + [ + "index", + "workflow_worker_compatibility_heartbeats_queue_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_worker_compatibility_heartbeats_queue_index ON public.workflow_worker_compatibility_heartbeats USING btree (queue)" + } + ], + [ + "index", + "workflow_worker_compatibility_heartbeats_scope_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_worker_compatibility_heartbeats_scope_unique ON public.workflow_worker_compatibility_heartbeats USING btree (worker_id, scope_key)" + } + ], + [ + "index", + "workflow_worker_registrations_namespace_task_queue_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_worker_registrations_namespace_task_queue_status_index ON public.workflow_worker_registrations USING btree (namespace, task_queue, status)" + } + ], + [ + "index", + "workflow_worker_registrations_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_worker_registrations_pkey ON public.workflow_worker_registrations USING btree (id)" + } + ], + [ + "index", + "workflow_worker_registrations_worker_id_namespace_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_worker_registrations_worker_id_namespace_unique ON public.workflow_worker_registrations USING btree (worker_id, namespace)" + } + ], + [ + "index", + "workflow_worker_sessions_namespace_lease_owner_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_worker_sessions_namespace_lease_owner_status_index ON public.workflow_worker_sessions USING btree (namespace, lease_owner, status)" + } + ], + [ + "index", + "workflow_worker_sessions_namespace_queue_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_worker_sessions_namespace_queue_status_index ON public.workflow_worker_sessions USING btree (namespace, queue, status)" + } + ], + [ + "index", + "workflow_worker_sessions_namespace_session_id_unique", + { + "ready": true, + "valid": true, + "unique": true, + "primary": false, + "definition": "CREATE UNIQUE INDEX workflow_worker_sessions_namespace_session_id_unique ON public.workflow_worker_sessions USING btree (namespace, session_id)" + } + ], + [ + "index", + "workflow_worker_sessions_namespace_status_index", + { + "ready": true, + "valid": true, + "unique": false, + "primary": false, + "definition": "CREATE INDEX workflow_worker_sessions_namespace_status_index ON public.workflow_worker_sessions USING btree (namespace, status)" + } + ], + [ + "index", + "workflow_worker_sessions_pkey", + { + "ready": true, + "valid": true, + "unique": true, + "primary": true, + "definition": "CREATE UNIQUE INDEX workflow_worker_sessions_pkey ON public.workflow_worker_sessions USING btree (id)" + } + ], + [ + "relation", + "_sqlx_migrations", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "activity_attempts", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "activity_executions", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_command_intents", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_external_payload_deletions", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_poll_receipts", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_query_cache", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_run_command_contracts", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_server_schema", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_service_admission_counters", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_service_call_deadlines", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_stream_reclaims", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_task_completions", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_task_queue_pauses", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_worker_registration_incarnations", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "dw_worker_session_holders", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "failed_jobs", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "failed_jobs_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "jobs", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "jobs_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "migrations", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "migrations_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "runtime_credentials", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "runtime_external_payload_backup_hold", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "runtime_external_payload_cleanup_stats", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "runtime_external_payload_object_locks", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "runtime_external_payloads", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "runtime_payload_completion_budgets", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "search_attribute_definitions", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "search_attribute_definitions_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_child_calls", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_child_calls_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_child_projection_repairs", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_commands", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_durable_stream_items", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_durable_stream_items_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_durable_streams", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_durable_streams_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_failures", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_history_events", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_inbound_stream_items", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_inbound_stream_items_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_inbound_streams", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_inbound_streams_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_instances", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_links", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_memos", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_memos_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_messages", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_messages_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_namespaces", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_namespaces_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_run_lineage_entries", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_run_summaries", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_run_timeline_entries", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_run_timer_entries", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_run_timers", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_run_waits", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_runs", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_schedule_history_events", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_schedules", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_search_attributes", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_search_attributes_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_service_calls", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_service_endpoints", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_service_operations", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_services", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_signal_records", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_task_poll_cursors", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_tasks", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_update_validation_tasks", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_updates", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_worker_build_id_rollouts", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_worker_build_id_rollouts_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_worker_compatibility_heartbeats", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_worker_compatibility_heartbeats_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_worker_registrations", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_worker_registrations_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_worker_sessions", + { + "kind": "r", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": "heap", + "partition_key": null, + "force_row_security": false + } + ], + [ + "relation", + "workflow_worker_sessions_id_seq", + { + "kind": "S", + "view": null, + "options": null, + "partition": false, + "persistence": "p", + "row_security": false, + "access_method": null, + "partition_key": null, + "force_row_security": false + } + ], + [ + "sequence", + "failed_jobs_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "failed_jobs.id", + "increment": 1 + } + ], + [ + "sequence", + "jobs_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "jobs.id", + "increment": 1 + } + ], + [ + "sequence", + "migrations_id_seq", + { + "max": 2147483647, + "min": 1, + "type": "integer", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "migrations.id", + "increment": 1 + } + ], + [ + "sequence", + "search_attribute_definitions_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "search_attribute_definitions.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_child_calls_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_child_calls.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_durable_stream_items_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_durable_stream_items.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_durable_streams_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_durable_streams.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_inbound_stream_items_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_inbound_stream_items.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_inbound_streams_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_inbound_streams.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_memos_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_memos.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_messages_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_messages.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_namespaces_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_namespaces.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_search_attributes_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_search_attributes.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_worker_build_id_rollouts_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_worker_build_id_rollouts.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_worker_compatibility_heartbeats_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_worker_compatibility_heartbeats.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_worker_registrations_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_worker_registrations.id", + "increment": 1 + } + ], + [ + "sequence", + "workflow_worker_sessions_id_seq", + { + "max": 9223372036854775807, + "min": 1, + "type": "bigint", + "cache": 1, + "cycle": false, + "start": 1, + "owned_by": "workflow_worker_sessions.id", + "increment": 1 + } + ] +] diff --git a/rust/migrations/postgres/0016_external_storage_bindings.sql b/rust/migrations/postgres/0016_external_storage_bindings.sql new file mode 100644 index 000000000..ae54ce778 --- /dev/null +++ b/rust/migrations/postgres/0016_external_storage_bindings.sql @@ -0,0 +1,4 @@ +-- Original object authority survives namespace write-policy changes. +ALTER TABLE public.runtime_external_payloads ADD COLUMN storage_binding TEXT NULL; +ALTER TABLE public.workflow_namespaces ADD COLUMN external_payload_storage_generation BIGINT NOT NULL DEFAULT 0; +UPDATE public.dw_server_schema SET version=16 WHERE engine='rust-development'; diff --git a/rust/migrations/sqlite/0014_checksum.txt b/rust/migrations/sqlite/0014_checksum.txt new file mode 100644 index 000000000..d175ef245 --- /dev/null +++ b/rust/migrations/sqlite/0014_checksum.txt @@ -0,0 +1 @@ +b0ba196a6a47cd9eaac081a7f6f215b5235a20da6ce0362d4f286125de95843b33add8f79bb3939464beefe8ee7b63d3 diff --git a/rust/migrations/sqlite/0015_external_storage_bindings.sql b/rust/migrations/sqlite/0015_external_storage_bindings.sql new file mode 100644 index 000000000..8bc43cacf --- /dev/null +++ b/rust/migrations/sqlite/0015_external_storage_bindings.sql @@ -0,0 +1,4 @@ +-- Original object authority survives namespace write-policy changes. +ALTER TABLE runtime_external_payloads ADD COLUMN storage_binding TEXT NULL; +ALTER TABLE workflow_namespaces ADD COLUMN external_payload_storage_generation INTEGER NOT NULL DEFAULT 0; +UPDATE dw_server_schema SET version=15 WHERE engine='rust-development'; diff --git a/rust/src/external_payload/local.rs b/rust/src/external_payload/local.rs index 1c9a68926..09b0f80bc 100644 --- a/rust/src/external_payload/local.rs +++ b/rust/src/external_payload/local.rs @@ -28,6 +28,15 @@ fn checked(reference: &Reference) -> Result<(), SnapshotError> { } impl LocalStorage { + /// An explicitly configured legacy root may use an alias. Resolve that + /// admitted name without creating directories, then pin the canonical root. + pub(crate) async fn open_declared_existing(root: PathBuf) -> Result { + let root = tokio::task::spawn_blocking(move || root.canonicalize().map_err(unavailable)) + .await + .map_err(unavailable)??; + Self::open_existing(root).await + } + /// Resolve retained storage without creating a replacement for a missing /// original root. A later symlink must not redirect the recorded owner. pub(crate) async fn open_existing(root: PathBuf) -> Result { diff --git a/rust/src/external_payload/storage_binding.rs b/rust/src/external_payload/storage_binding.rs index 6a561e0bf..9d7c303ab 100644 --- a/rust/src/external_payload/storage_binding.rs +++ b/rust/src/external_payload/storage_binding.rs @@ -2,7 +2,7 @@ //! public reference stays opaque and never carries these filesystem details. use super::{LocalStorage, Reference, SnapshotError}; use serde::{Deserialize, Serialize}; -use serde_json::{Value, json}; +use serde_json::Value; use std::path::{Component, PathBuf}; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] @@ -58,6 +58,7 @@ impl StorageBinding { } /// Closed shape, owner and exact object address precede all filesystem I/O. + #[cfg(test)] pub(crate) fn decode( value: Value, namespace: &str, @@ -65,6 +66,26 @@ impl StorageBinding { uri: &str, ) -> Option { let binding: Self = serde_json::from_value(value).ok()?; + binding.validate_address(namespace, reference, uri) + } + + pub(crate) fn decode_stored( + value: &str, + namespace: &str, + reference: &Reference, + uri: &str, + ) -> Option { + if value.len() > 32_768 { + return None; + } + // Deserialize the original text directly: a Value round trip would + // erase duplicate keys before the closed-struct decoder sees them. + let binding: Self = serde_json::from_str(value).ok()?; + binding.validate_address(namespace, reference, uri) + } + + fn validate_address(self, namespace: &str, reference: &Reference, uri: &str) -> Option { + let binding = self; let root = binding.root(namespace)?; if LocalStorage::address_at(root, reference).ok()? != uri { return None; @@ -72,6 +93,28 @@ impl StorageBinding { Some(binding) } + pub(crate) fn encode(&self) -> Option { + let encoded = serde_json::to_string(self).ok()?; + (encoded.len() <= 32_768).then_some(encoded) + } + + /// A deletion journal has already released the registration. Its original + /// binding still limits deletion to the exact content-addressed object. + pub(crate) fn decode_deletion(value: &str, namespace: &str, uri: &str) -> Option { + let digest = uri.rsplit('/').next()?; + if digest.len() != 64 || !digest.bytes().all(|b| b.is_ascii_hexdigit()) { + return None; + } + let reference = Reference { + schema: super::REFERENCE_SCHEMA, + reference_id: "ep_00000000000000000000000000".into(), + codec: "avro", + size_bytes: 0, + sha256: digest.to_owned(), + }; + Self::decode_stored(value, namespace, &reference, uri) + } + pub(crate) async fn storage(&self) -> Result { let root = self .root(&self.namespace) @@ -81,13 +124,14 @@ impl StorageBinding { pub(crate) fn deletion_policy(&self) -> Value { // Reads/reclamation are independent of the newest upload-enable flag. - json!({"driver":"local","enabled":true,"config":{"uri":self.root_uri}}) + serde_json::to_value(self).expect("a binding contains only portable scalars") } } #[cfg(test)] mod tests { use super::*; + use serde_json::json; fn reference() -> Reference { Reference::validate(&json!({"schema":super::super::REFERENCE_SCHEMA, @@ -140,7 +184,7 @@ mod tests { .len(), 5 ); - assert_eq!(original.deletion_policy()["enabled"], true); + assert_eq!(original.deletion_policy()["generation"], 1); } #[tokio::test] @@ -176,6 +220,35 @@ mod tests { ); } + #[tokio::test] + async fn original_text_rejects_duplicate_fields_and_deletion_keeps_the_exact_owner() { + let temporary = tempfile::tempdir().unwrap(); + let storage = LocalStorage::open(temporary.path().join("original")) + .await + .unwrap(); + let reference = reference(); + let uri = storage.uri_for(&reference).unwrap(); + let binding = StorageBinding::new("default", 1, &storage).unwrap(); + let encoded = binding.encode().unwrap(); + assert!(StorageBinding::decode_stored(&encoded, "default", &reference, &uri).is_some()); + let duplicated = encoded.replace( + "\"namespace\":\"default\"", + "\"namespace\":\"peer\",\"namespace\":\"default\"", + ); + assert_ne!(duplicated, encoded); + assert!(StorageBinding::decode_stored(&duplicated, "default", &reference, &uri).is_none()); + assert!(StorageBinding::decode_deletion(&encoded, "default", &uri).is_some()); + assert!(StorageBinding::decode_deletion(&encoded, "peer", &uri).is_none()); + assert!( + StorageBinding::decode_deletion(&encoded, "default", "file:///foreign/avro/00/invalid") + .is_none() + ); + assert!( + StorageBinding::decode_stored(&" ".repeat(32_769), "default", &reference, &uri) + .is_none() + ); + } + #[tokio::test] async fn a_missing_retained_root_is_not_recreated() { let temporary = tempfile::tempdir().unwrap(); diff --git a/rust/src/runtime/execution.rs b/rust/src/runtime/execution.rs index 2aa4c8b88..ff4ee288b 100644 --- a/rust/src/runtime/execution.rs +++ b/rust/src/runtime/execution.rs @@ -478,15 +478,13 @@ impl Runtime { delegate!(system_metrics() -> Result); delegate!(prometheus_metrics() -> Result); delegate!(payload_cleanup_status(config: &super::operator_metrics::MetricsConfig) -> Result); - /// The namespace's payload cleanup pass, with its local storage when an - /// enabled local policy names it. + /// Reclaim each registered object through its original storage binding. pub(crate) async fn payload_cleanup_pass(&self, limit: i64) -> Result { - let local = super::external_transport::local(self).await.ok(); let retention = self.external.abandoned_seconds; match &*self.storage { - Storage::Sqlite(store) => store.payload_cleanup_pass(limit, retention, local.as_ref()).await, - Storage::Postgres(store) => store.payload_cleanup_pass(limit, retention, local.as_ref()).await, - Storage::MySql(store) => store.payload_cleanup_pass(limit, retention, local.as_ref()).await, + Storage::Sqlite(store) => store.payload_cleanup_pass(limit, retention).await, + Storage::Postgres(store) => store.payload_cleanup_pass(limit, retention).await, + Storage::MySql(store) => store.payload_cleanup_pass(limit, retention).await, } } delegate!(change_backup_hold(action: super::backup_hold::Action, request: &super::backup_hold::Request) -> Result); @@ -532,6 +530,12 @@ impl Runtime { expected: &crate::external_payload::Reference, ) -> Result ); + delegate!( + external_payload_storage( + expected: &crate::external_payload::Reference, + uri: &str, + ) -> Result + ); delegate!( authorize_completion_upload( context: &super::activity_completion_uploads::Context, diff --git a/rust/src/runtime/external_registry.rs b/rust/src/runtime/external_registry.rs index df92a3653..05445871f 100644 --- a/rust/src/runtime/external_registry.rs +++ b/rust/src/runtime/external_registry.rs @@ -20,6 +20,12 @@ pub(crate) struct RegisteredPayload { pub(super) uri: String, } +enum StorageAdmission<'a> { + Current(&'a crate::external_payload::LocalStorage), + #[cfg(test)] + LegacyTest, +} + fn hash(value: &str) -> String { Sha256::digest(value.as_bytes()) .iter() @@ -55,7 +61,8 @@ where for<'r> i64: Decode<'r, DB>, usize: ColumnIndex, { - fn payload_row(row: &DB::Row) -> Result { + pub(super) fn payload_row(row: &DB::Row) -> Result { + if DB::string(row, "codec")? != "avro" { return Err(mismatch()); } Ok(RegisteredPayload { reference: Reference { schema: REFERENCE_SCHEMA, @@ -68,7 +75,7 @@ where }) } - fn match_payload(row: &DB::Row, expected: &Reference, uri: Option<&str>) -> Result<()> { + pub(super) fn match_payload(row: &DB::Row, expected: &Reference, uri: Option<&str>) -> Result<()> { let uri_mismatch = if let Some(uri) = uri { DB::string(row, "storage_uri")? != uri } else { @@ -202,17 +209,31 @@ where .uri_for(&expected) .map_err(super::external_transport::snapshot_error)?; let reference = self - .prepare_external_upload_with_quota(&expected, &uri, expires, quota) + .prepare_external_upload_admitted(&expected, &uri, expires, quota, StorageAdmission::Current(&local)) .await?; + self.finish_external_local_upload(reference, &uri, snapshot, completion).await + } + + /// The committed registration is the authority for a previously admitted + /// write, including when the namespace policy changes between phases. + async fn finish_external_local_upload( + &self, + reference: Reference, + uri: &str, + snapshot: crate::external_payload::Snapshot, + completion: Option<&super::activity_completion_uploads::Context>, + ) -> Result { let mut tx = self.begin().await?; - Self::payload_object_lock(&mut tx, &uri).await?; + Self::payload_object_lock(&mut tx, uri).await?; // Recheck registration after acquiring the provider lock. Cleanup may // have removed an abandoned row before this write was admitted. - if Self::scalar("SELECT COUNT(*) FROM runtime_external_payloads WHERE id=$1 AND namespace=$2 AND storage_uri=$3") - .bind(&reference.reference_id).bind(self.namespace.as_ref()).bind(&uri) - .fetch_one(&mut *tx).await? != 1 { - return Err(refuse(StatusCode::SERVICE_UNAVAILABLE, "external_payload_unavailable")); - } + let admitted = Self::query("SELECT storage_binding FROM runtime_external_payloads WHERE id=$1 AND namespace=$2 AND storage_uri=$3") + .bind(&reference.reference_id).bind(self.namespace.as_ref()).bind(uri) + .fetch_optional(&mut *tx).await?.ok_or_else(super::external_storage_binding::unavailable)?; + let binding = DB::optional_string(&admitted, "storage_binding")?.ok_or_else(super::external_storage_binding::unavailable)?; + let binding = crate::external_payload::StorageBinding::decode_stored(&binding, self.namespace.as_ref(), &reference, uri) + .ok_or_else(super::external_storage_binding::unavailable)?; + let local = binding.storage().await.map_err(|_| super::external_storage_binding::unavailable())?; if let Some(context) = completion { self.completion_upload_lease(&mut tx, context).await?; } @@ -223,18 +244,25 @@ where if let Some(context) = completion { self.completion_upload_lease(&mut tx, context).await?; } - self.promote_external_upload(&mut tx, &reference, &uri) + self.promote_external_upload(&mut tx, &reference, uri) .await?; tx.commit().await?; Ok(reference) } + #[cfg(test)] pub(super) async fn prepare_external_upload_with_quota( &self, expected: &Reference, uri: &str, expires: DateTime, quota: Quota, + ) -> Result { + self.prepare_external_upload_admitted(expected, uri, expires, quota, StorageAdmission::LegacyTest).await + } + + async fn prepare_external_upload_admitted( + &self, expected: &Reference, uri: &str, expires: DateTime, quota: Quota, admission: StorageAdmission<'_>, ) -> Result { let value = serde_json::to_value(expected)?; if !Reference::validate(&value).is_ok_and(|canonical| canonical == *expected) @@ -243,6 +271,11 @@ where return Err(mismatch()); } let mut tx = self.begin().await?; + let binding = match admission { + StorageAdmission::Current(local) => Some(Self::admit_storage_binding(&mut tx, self.namespace.as_ref(), local, expected, uri).await?), + #[cfg(test)] + StorageAdmission::LegacyTest => None, + }; Self::payload_object_lock(&mut tx, uri).await?; let uri_hash = hash(uri); let existing = Self::query( @@ -255,6 +288,11 @@ where let timestamp = now(); let reference = if let Some(row) = existing { Self::match_payload(&row, expected, Some(uri))?; + if binding.is_some() { + let stored = DB::optional_string(&row, "storage_binding")?; + let registered = Self::payload_row(&row)?; + Self::retained_storage_binding(&mut tx, self.namespace.as_ref(), ®istered.reference, uri, stored.as_deref()).await?; + } let status = DB::string(&row, "upload_status")?; if status != "ready" && status != "writing" { return Err(refuse(StatusCode::CONFLICT, "external_payload_unavailable")); @@ -312,10 +350,15 @@ where reference_id: format!("ep_{}", id()), ..expected.clone() }; - Self::query("INSERT INTO runtime_external_payloads(id,namespace,storage_uri,storage_uri_sha256,codec,sha256,size_bytes,upload_status,retained_at,expires_at,last_fetched_at,created_at,updated_at) VALUES ($1,$2,$3,$4,$5,$6,$7,'writing',NULL,$8,NULL,$9,$10)") + let encoded = match binding.as_ref() { + Some(binding) => Some(binding.encode().ok_or_else(super::external_storage_binding::unavailable)?), + None => None, + }; + Self::query("INSERT INTO runtime_external_payloads(id,namespace,storage_uri,storage_uri_sha256,codec,sha256,size_bytes,upload_status,retained_at,expires_at,last_fetched_at,created_at,updated_at,storage_binding) VALUES ($1,$2,$3,$4,$5,$6,$7,'writing',NULL,$8,NULL,$9,$10,$11)") .bind(&reference.reference_id).bind(self.namespace.as_ref()).bind(uri).bind(&uri_hash) .bind(reference.codec).bind(&reference.sha256).bind(reference.size_bytes) .bind(DB::bind_time(expires)).bind(DB::bind_time(timestamp)).bind(DB::bind_time(timestamp)) + .bind(encoded.as_deref()) .execute(&mut *tx).await?; reference }; @@ -456,6 +499,76 @@ mod tests { } } + #[tokio::test] + async fn a_policy_move_before_admission_refuses_the_cached_root_before_any_provider_write() { + let temp = tempfile::tempdir().unwrap(); + let store = Store::::new(super::super::sqlite::open(temp.path().join("db.sqlite").to_str().unwrap()).await.unwrap()); + store.initialize_namespace_registry().await.unwrap(); + let root = temp.path().join("original"); + let local = LocalStorage::open(root.clone()).await.unwrap(); + store.set_external_policy("default", serde_json::json!({"driver":"local","enabled":true,"config":{"uri":format!("file://{}",root.display())}})).await.unwrap(); + let replacement = temp.path().join("replacement"); + LocalStorage::open(replacement.clone()).await.unwrap(); + store.set_external_policy("default", serde_json::json!({"driver":"local","enabled":true,"config":{"uri":format!("file://{}",replacement.display())}})).await.unwrap(); + let bytes = b"cached provider root is no longer admitted"; + let metadata = expected(bytes); + let snapshot = capture(Cursor::new(bytes.to_vec()), metadata.clone(), 100, temp.path().into(), Arc::new(Semaphore::new(1))).await.unwrap(); + let error = store.upload_external_local(local, metadata.clone(), snapshot, now()+chrono::Duration::seconds(60), Quota::default()).await.unwrap_err(); + assert_eq!(reason(error), "external_payload_storage_binding_unavailable"); + let count: i64 = sqlx::query_scalar("SELECT COUNT(*) FROM runtime_external_payloads").fetch_one(&store.pool).await.unwrap(); + assert_eq!(count, 0); + assert!(!root.join("avro").exists()); + assert!(!replacement.join("avro").exists()); + store.pool.close().await; + } + + #[tokio::test] + async fn a_committed_write_finishes_at_its_original_root_after_disable_or_move() { + for disabled in [false, true] { + let temp = tempfile::tempdir().unwrap(); + let store = Store::::new(super::super::sqlite::open(temp.path().join("db.sqlite").to_str().unwrap()).await.unwrap()); + store.initialize_namespace_registry().await.unwrap(); + let root = temp.path().join("original"); + let local = LocalStorage::open(root.clone()).await.unwrap(); + store.set_external_policy("default", serde_json::json!({"driver":"local","enabled":true,"config":{"uri":format!("file://{}",root.display())}})).await.unwrap(); + let bytes = b"write admitted before policy change"; + let metadata = expected(bytes); + let uri = local.uri_for(&metadata).unwrap(); + let reference = store.prepare_external_upload_admitted(&metadata, &uri, now()+chrono::Duration::seconds(60), Quota::default(), StorageAdmission::Current(&local)).await.unwrap(); + let original: String = sqlx::query_scalar("SELECT storage_binding FROM runtime_external_payloads").fetch_one(&store.pool).await.unwrap(); + let replacement = temp.path().join("replacement"); + store.set_external_policy("default", if disabled { serde_json::json!({"driver":"local","enabled":false}) } else { serde_json::json!({"driver":"local","enabled":true,"config":{"uri":format!("file://{}",replacement.display())}}) }).await.unwrap(); + let snapshot = capture(Cursor::new(bytes.to_vec()), reference.clone(), 100, temp.path().into(), Arc::new(Semaphore::new(1))).await.unwrap(); + assert_eq!(store.finish_external_local_upload(reference.clone(), &uri, snapshot, None).await.unwrap(), reference); + let row: (String, String) = sqlx::query_as("SELECT upload_status,storage_binding FROM runtime_external_payloads").fetch_one(&store.pool).await.unwrap(); + assert_eq!(row, ("ready".into(), original)); + assert!(root.join("avro").exists()); + assert!(!replacement.exists()); + store.pool.close().await; + } + } + + #[tokio::test] + async fn an_original_root_lost_after_write_admission_is_not_recreated() { + let temp = tempfile::tempdir().unwrap(); + let store = Store::::new(super::super::sqlite::open(temp.path().join("db.sqlite").to_str().unwrap()).await.unwrap()); + store.initialize_namespace_registry().await.unwrap(); + let root = temp.path().join("original"); + let local = LocalStorage::open(root.clone()).await.unwrap(); + store.set_external_policy("default", serde_json::json!({"driver":"local","enabled":true,"config":{"uri":format!("file://{}",root.display())}})).await.unwrap(); + let bytes = b"original provider is offline"; + let metadata = expected(bytes); + let uri = local.uri_for(&metadata).unwrap(); + let reference = store.prepare_external_upload_admitted(&metadata, &uri, now()+chrono::Duration::seconds(60), Quota::default(), StorageAdmission::Current(&local)).await.unwrap(); + std::fs::remove_dir(&root).unwrap(); + let snapshot = capture(Cursor::new(bytes.to_vec()), reference.clone(), 100, temp.path().into(), Arc::new(Semaphore::new(1))).await.unwrap(); + assert_eq!(reason(store.finish_external_local_upload(reference, &uri, snapshot, None).await.unwrap_err()), "external_payload_storage_binding_unavailable"); + assert!(!root.exists()); + let status: String = sqlx::query_scalar("SELECT upload_status FROM runtime_external_payloads").fetch_one(&store.pool).await.unwrap(); + assert_eq!(status, "writing"); + store.pool.close().await; + } + #[tokio::test] async fn writing_row_survives_failed_promotion_and_same_id_retry_recovers_exact_bytes() { let temp = tempfile::tempdir().unwrap(); diff --git a/rust/src/runtime/external_resolution.rs b/rust/src/runtime/external_resolution.rs index 455a9b1ff..4941c9ce7 100644 --- a/rust/src/runtime/external_resolution.rs +++ b/rust/src/runtime/external_resolution.rs @@ -156,7 +156,7 @@ impl Runtime { "external_payload_integrity_mismatch", )); } - let storage = super::external_transport::local(self).await?; + let storage = self.external_payload_storage(®istered.reference, ®istered.uri).await?; let snapshot = match permit { Some(permit) => { storage diff --git a/rust/src/runtime/external_storage_binding.rs b/rust/src/runtime/external_storage_binding.rs new file mode 100644 index 000000000..f577d4748 --- /dev/null +++ b/rust/src/runtime/external_storage_binding.rs @@ -0,0 +1,162 @@ +//! Original storage authority for retained objects, independent of the latest +//! namespace write policy. Namespace/registry changes share the native DB lock. +use super::{Result, RuntimeError, refuse, transaction::Transaction}; +use crate::external_payload::{LocalStorage, Reference, StorageBinding}; +use axum::http::StatusCode; +use serde_json::Value; + +pub(super) fn unavailable() -> RuntimeError { + refuse( + StatusCode::CONFLICT, + "external_payload_storage_binding_unavailable", + ) +} + +/// Resolve an admitted policy name without creating a missing original root. +/// Disabled means no new writes, not loss of authority over retained objects. +pub(super) async fn retained_local( + policy: &Value, + namespace: &str, +) -> Result> { + if policy.is_null() || policy["driver"] != "local" { + return Ok(None); + } + LocalStorage::open_declared_existing(super::external_transport::local_root(policy, namespace)?) + .await + .map(Some) + .map_err(|_| unavailable()) +} + +pub(super) async fn deletion_storage( + encoded: &str, + namespace: &str, + uri: &str, +) -> Result> { + if encoded.len() > 65_536 { + return Err(unavailable()); + } + let shape: Value = serde_json::from_str(encoded).map_err(|_| unavailable())?; + if shape.get("version").is_some() + || shape.get("root_uri").is_some() + || shape.get("generation").is_some() + { + let binding = + StorageBinding::decode_deletion(encoded, namespace, uri).ok_or_else(unavailable)?; + return binding.storage().await.map(Some).map_err(|_| unavailable()); + } + // Previously committed journals retain their saved original policy. They + // also must not create an empty replacement for a missing provider root. + retained_local(&shape, namespace).await +} + +store_methods! { + pub(super) async fn external_storage_policy( + tx: &mut Transaction<'_, DB>, namespace: &str, + ) -> Result<(Value, i64)> { + let row = Self::query("SELECT external_payload_storage,external_payload_storage_generation FROM workflow_namespaces WHERE name=$1") + .bind(namespace).fetch_optional(&mut **tx).await? + .ok_or_else(|| refuse(StatusCode::NOT_FOUND, "namespace_not_found"))?; + let policy = DB::optional_document_row(&row, "external_payload_storage")?.unwrap_or(Value::Null); + let stored = DB::number(&row, "external_payload_storage_generation")?; + if stored < 0 { return Err(unavailable()); } + // Existing native/PHP policy rows predate the internal generation. + let generation = if stored == 0 && !policy.is_null() { 1 } else { stored }; + Ok((policy, generation)) + } + + /// Must run in the same transaction that admits the writing registration. + pub(super) async fn admit_storage_binding( + tx: &mut Transaction<'_, DB>, namespace: &str, local: &LocalStorage, + reference: &Reference, uri: &str, + ) -> Result { + let (policy, generation) = Self::external_storage_policy(tx, namespace).await?; + if policy.is_null() || policy["driver"] != "local" || policy["enabled"] == false { + return Err(refuse(StatusCode::SERVICE_UNAVAILABLE, "external_payload_unavailable")); + } + let selected = retained_local(&policy, namespace).await?.ok_or_else(unavailable)?; + if selected.uri_for(reference).ok().as_deref() != Some(uri) + || local.uri_for(reference).ok().as_deref() != Some(uri) { + return Err(unavailable()); + } + StorageBinding::new(namespace, generation, local).ok_or_else(unavailable) + } + + async fn persist_storage_binding( + tx: &mut Transaction<'_, DB>, namespace: &str, reference: &Reference, binding: &StorageBinding, + ) -> Result<()> { + let encoded = binding.encode().ok_or_else(unavailable)?; + let changed = Self::query("UPDATE runtime_external_payloads SET storage_binding=$1 WHERE id=$2 AND namespace=$3 AND storage_binding IS NULL") + .bind(encoded).bind(&reference.reference_id).bind(namespace).execute(&mut **tx).await?; + if DB::affected(changed) != 1 { return Err(unavailable()); } + Ok(()) + } + + pub(super) async fn retained_storage_binding( + tx: &mut Transaction<'_, DB>, namespace: &str, reference: &Reference, uri: &str, stored: Option<&str>, + ) -> Result { + if let Some(stored) = stored { + return StorageBinding::decode_stored(stored, namespace, reference, uri).ok_or_else(unavailable); + } + // Lazy backfill uses the admitted policy only if its exact address + // reproduces the registration. A path in an arbitrary URI is not a grant. + let (policy, generation) = Self::external_storage_policy(tx, namespace).await?; + let local = retained_local(&policy, namespace).await?.ok_or_else(unavailable)?; + if local.uri_for(reference).ok().as_deref() != Some(uri) { return Err(unavailable()); } + let binding = StorageBinding::new(namespace, generation, &local).ok_or_else(unavailable)?; + Self::persist_storage_binding(tx, namespace, reference, &binding).await?; + Ok(binding) + } + + /// Freeze old registrations before changing their policy. An explicit new + /// root can also repair a legacy policy only where the recorded URI agrees. + pub(super) async fn pin_legacy_payloads( + tx: &mut Transaction<'_, DB>, namespace: &str, candidate: Option<(&Value, i64)>, + ) -> Result<()> { + let rows = Self::query("SELECT * FROM runtime_external_payloads WHERE namespace=$1 AND storage_binding IS NULL ORDER BY id") + .bind(namespace).fetch_all(&mut **tx).await?; + if rows.is_empty() { return Ok(()); } + let (policy, generation) = Self::external_storage_policy(tx, namespace).await?; + let original = retained_local(&policy, namespace).await.ok().flatten().map(|local| (local, generation)); + let replacement = match candidate { + Some((policy, generation)) => retained_local(policy, namespace).await.ok().flatten().map(|local| (local, generation)), + None => None, + }; + for row in rows { + if DB::string(&row, "codec")? != "avro" { return Err(unavailable()); } + let registered = Self::payload_row(&row)?; + let matches = |(local, _): &&(LocalStorage, i64)| local.uri_for(®istered.reference).ok().as_deref() == Some(registered.uri.as_str()); + let (local, generation) = original.as_ref().filter(matches).or_else(|| replacement.as_ref().filter(matches)) + .ok_or_else(unavailable)?; + let binding = StorageBinding::new(namespace, *generation, local).ok_or_else(unavailable)?; + Self::persist_storage_binding(tx, namespace, ®istered.reference, &binding).await?; + } + Ok(()) + } + + /// Metadata and expiry are checked again under the object lock. Claiming + /// retained ownership remains a separate original operation. + pub(super) async fn external_payload_storage(&self, expected: &Reference, uri: &str) -> Result { + let mut tx = self.begin().await?; + Self::payload_object_lock(&mut tx, uri).await?; + let row = Self::query("SELECT * FROM runtime_external_payloads WHERE id=$1 AND namespace=$2 AND upload_status='ready'") + .bind(&expected.reference_id).bind(self.namespace.as_ref()).fetch_optional(&mut *tx).await? + .ok_or_else(|| refuse(StatusCode::NOT_FOUND, "external_payload_not_found"))?; + Self::match_payload(&row, expected, Some(uri))?; + if DB::optional_instant(&row, "retained_at")?.is_none() + && DB::optional_instant(&row, "expires_at")?.is_some_and(|expiry| expiry < super::store::now()) { + return Err(refuse(StatusCode::GONE, "external_payload_expired")); + } + let stored = DB::optional_string(&row, "storage_binding")?; + let binding = Self::retained_storage_binding(&mut tx, self.namespace.as_ref(), expected, uri, stored.as_deref()).await?; + tx.commit().await?; + binding.storage().await.map_err(|_| unavailable()) + } + + pub(super) async fn bound_deletion_policy( + tx: &mut Transaction<'_, DB>, namespace: &str, reference: &Reference, uri: &str, stored: Option<&str>, + ) -> Result { + let binding = Self::retained_storage_binding(tx, namespace, reference, uri, stored).await?; + binding.storage().await.map_err(|_| unavailable())?; + Ok(binding.deletion_policy()) + } +} diff --git a/rust/src/runtime/external_transport.rs b/rust/src/runtime/external_transport.rs index 9d6cee776..865e204e7 100644 --- a/rust/src/runtime/external_transport.rs +++ b/rust/src/runtime/external_transport.rs @@ -33,6 +33,7 @@ pub(super) const TYPED_REASONS: &[&str] = &[ "external_payload_expired", "external_payload_unauthorized", "external_payload_unavailable", + "external_payload_storage_binding_unavailable", "external_payload_oversized", "external_payload_unsupported", "external_payload_integrity_mismatch", @@ -56,6 +57,7 @@ fn message(reason: &str) -> &str { "external_payload_unsupported" => "External payload envelopes must contain exactly codec and external_payload.", "external_payload_integrity_mismatch" => "External payload envelope codec does not match the runtime reference.", "external_payload_unavailable" => "External payload storage is temporarily unavailable.", + "external_payload_storage_binding_unavailable" => "The original external payload storage binding is unavailable or invalid.", "external_payload_completion_invalid" => "A canonical worker completion context is required.", "external_payload_completion_lease_rejected" => "The payload upload does not belong to a current worker completion lease.", "external_payload_completion_conflict" => "A completion payload slot is already bound to different bytes.", @@ -262,7 +264,11 @@ pub(super) async fn local_for(policy: &Value, namespace: &str) -> Result Result { + Ok(match policy["config"]["uri"] .as_str() .and_then(|uri| uri.strip_prefix("file://")) { @@ -270,8 +276,7 @@ pub(super) async fn local_for(policy: &Value, namespace: &str) -> Result std::env::current_dir()? .join("storage/app/external-payloads") .join(namespace), - }; - LocalStorage::open(root).await.map(Some).map_err(snapshot_error) + }) } pub(super) async fn set_policy( @@ -427,7 +432,7 @@ async fn fetch_inner(runtime: Runtime, identity: String, headers: HeaderMap) -> )); } let registered = runtime.external_payload_for_fetch(&expected).await?; - let snapshot = local(&runtime) + let snapshot = runtime.external_payload_storage(®istered.reference, ®istered.uri) .await? .fetch( registered.reference, diff --git a/rust/src/runtime/mod.rs b/rust/src/runtime/mod.rs index 0261a533a..dd82dfeb5 100644 --- a/rust/src/runtime/mod.rs +++ b/rust/src/runtime/mod.rs @@ -66,6 +66,7 @@ mod carried_poll_tests; mod execution; mod external_config; mod external_registry; +mod external_storage_binding; mod external_resolution; mod signal_payloads; mod external_transport; diff --git a/rust/src/runtime/mysql.rs b/rust/src/runtime/mysql.rs index 116e652b6..a61d8081f 100644 --- a/rust/src/runtime/mysql.rs +++ b/rust/src/runtime/mysql.rs @@ -13,9 +13,10 @@ use std::{collections::BTreeMap, sync::OnceLock, time::Duration}; /// exact text (server#1016); MariaDB already stores them as text and stayed /// at 12. Each then adds task queue pauses (server#577): MySQL 14, MariaDB /// 13, and keyed command intents (server#934): MySQL 15, MariaDB 14. +/// Immutable external storage bindings are MySQL 17 / MariaDB 16. /// `Flavor::version` selects the one a server needs. -pub const MYSQL_VERSION: i64 = 16; -pub const MARIADB_VERSION: i64 = 15; +pub const MYSQL_VERSION: i64 = 17; +pub const MARIADB_VERSION: i64 = 16; type Catalog = Vec<(String, String)>; pub const MARKER_SQL: &str = "CREATE TABLE dw_server_schema (engine VARCHAR(64) NOT NULL PRIMARY KEY,version BIGINT NOT NULL,bootstrap_checksum VARBINARY(48) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin"; @@ -42,6 +43,88 @@ impl Flavor { }) } fn migrator(self) -> &'static Migrator { + static MYSQL: OnceLock = OnceLock::new(); + static MARIA: OnceLock = OnceLock::new(); + let (slot, sql) = match self { + Self::MySql => ( + &MYSQL, + concat!( + include_str!("../../migrations/mysql/0003_full_schema.sql"), + "\n", + include_str!("../../migrations/mysql/0004_worker_incarnations.sql"), + "\n", + include_str!("../../migrations/mysql/0005_worker_session_holders.sql"), + "\n", + include_str!("../../migrations/mysql/0006_stream_reclaims.sql"), + "\n", + include_str!("../../migrations/mysql/0007_service_calls.sql"), + "\n", + include_str!("../../migrations/mysql/0008_external_payload_deletions.sql"), + "\n", + include_str!("../../migrations/mysql/0009_task_ready_origin.sql"), + "\n", + include_str!("../../migrations/mysql/0010_poll_expiry_indexes.sql"), + "\n", + include_str!("../../migrations/mysql/0011_scoped_dispatch_index.sql"), + "\n", + include_str!("../../migrations/mysql/0012_run_command_contracts.sql"), + "\n", + include_str!("../../migrations/mysql/0013_json_text.sql"), + "\n", + include_str!("../../migrations/mysql/0014_task_queue_pauses.sql"), + "\n", + include_str!("../../migrations/mysql/0015_command_intents.sql"), "\n", include_str!("../../migrations/mysql/0016_schedule_dispatch_summary.sql"), "\n", include_str!("../../migrations/mysql/0017_external_storage_bindings.sql") + ), + ), + Self::MariaDb => ( + &MARIA, + concat!( + include_str!("../../migrations/mariadb/0003_full_schema.sql"), + "\n", + include_str!("../../migrations/mariadb/0004_worker_incarnations.sql"), + "\n", + include_str!("../../migrations/mariadb/0005_worker_session_holders.sql"), + "\n", + include_str!("../../migrations/mariadb/0006_stream_reclaims.sql"), + "\n", + include_str!("../../migrations/mariadb/0007_service_calls.sql"), + "\n", + include_str!("../../migrations/mariadb/0008_external_payload_deletions.sql"), + "\n", + include_str!("../../migrations/mariadb/0009_task_ready_origin.sql"), + "\n", + include_str!("../../migrations/mariadb/0010_poll_expiry_indexes.sql"), + "\n", + include_str!("../../migrations/mariadb/0011_scoped_dispatch_index.sql"), + "\n", + include_str!("../../migrations/mariadb/0012_run_command_contracts.sql"), + "\n", + include_str!("../../migrations/mariadb/0013_task_queue_pauses.sql"), + "\n", + include_str!("../../migrations/mariadb/0014_command_intents.sql"), "\n", include_str!("../../migrations/mariadb/0015_schedule_dispatch_summary.sql"), "\n", include_str!("../../migrations/mariadb/0016_external_storage_bindings.sql") + ), + ), + }; + slot.get_or_init(|| { + let description = match self { + Self::MySql => "full frozen PHP schema, native worker incarnations, session holders, stream reclaim deadlines, service call deadlines, service admission counters and committed external payload deletions and task ready origins and poll expiry indexes and scoped dispatch index and bound run command contracts and exact JSON text documents and task queue activity dispatch pauses and keyed command intents and bounded schedule dispatch summaries and immutable external storage bindings", + Self::MariaDb => "full frozen PHP schema, native worker incarnations, session holders, stream reclaim deadlines, service call deadlines, service admission counters and committed external payload deletions and task ready origins and poll expiry indexes and scoped dispatch index and bound run command contracts and task queue activity dispatch pauses and keyed command intents and bounded schedule dispatch summaries and immutable external storage bindings", + }; + let mut migrations = Migrator::with_migrations(vec![Migration::new( + self.version(), + description.into(), + MigrationType::Simple, + AssertSqlSafe(self.bootstrap_sql(sql)).into_sql_str(), + false, + )]); + // A bounded named lock on this dedicated initialization connection + // covers preflight, DDL, resumption and final marking. + migrations.set_locking(false); + migrations + }) + } + // Keep exact current-predecessor bootstraps, including SQLx checksums. + fn retained_storage_predecessor(self) -> &'static Migrator { static MYSQL: OnceLock = OnceLock::new(); static MARIA: OnceLock = OnceLock::new(); let (slot, sql) = match self { @@ -110,7 +193,7 @@ impl Flavor { Self::MariaDb => "full frozen PHP schema, native worker incarnations, session holders, stream reclaim deadlines, service call deadlines, service admission counters and committed external payload deletions and task ready origins and poll expiry indexes and scoped dispatch index and bound run command contracts and task queue activity dispatch pauses and keyed command intents and bounded schedule dispatch summaries", }; let mut migrations = Migrator::with_migrations(vec![Migration::new( - self.version(), + match self { Self::MySql => 16, Self::MariaDb => 15 }, description.into(), MigrationType::Simple, AssertSqlSafe(self.bootstrap_sql(sql)).into_sql_str(), @@ -130,8 +213,8 @@ impl Flavor { } fn expected(self) -> Result { Ok(serde_json::from_str(&canonical(match self { - Self::MySql => include_str!("../../migrations/mysql/0016_catalog.json"), - Self::MariaDb => include_str!("../../migrations/mariadb/0015_catalog.json"), + Self::MySql => include_str!("../../migrations/mysql/0017_catalog.json"), + Self::MariaDb => include_str!("../../migrations/mariadb/0016_catalog.json"), }))?) } /// The single native migration, which a takeover records as applied. @@ -237,6 +320,8 @@ impl Flavor { static DISPATCH_MYSQL: OnceLock = OnceLock::new(); static DISPATCH_MARIADB: OnceLock = OnceLock::new(); match (self, version) { + (Self::MySql, 16) => self.retained_storage_predecessor().iter().next().map(|migration| (migration, include_str!("../../migrations/mysql/0016_catalog.json"))), + (Self::MariaDb, 15) => self.retained_storage_predecessor().iter().next().map(|migration| (migration, include_str!("../../migrations/mariadb/0015_catalog.json"))), (Self::MariaDb, 14) => Some((DISPATCH_MARIADB.get_or_init(|| Migration::new(14, "full frozen PHP schema, native worker incarnations, session holders, stream reclaim deadlines, service call deadlines, service admission counters and committed external payload deletions and task ready origins and poll expiry indexes and scoped dispatch index and bound run command contracts and task queue activity dispatch pauses and keyed command intents".into(), MigrationType::Simple, AssertSqlSafe(self.bootstrap_sql(concat!( include_str!("../../migrations/mariadb/0003_full_schema.sql"), "\n", @@ -645,6 +730,8 @@ impl Flavor { /// The step file that moves a native database from `version` to the next. fn step(self, version: i64) -> Option<&'static str> { match (self, version) { + (Self::MySql, 16) => Some(include_str!("../../migrations/mysql/0017_external_storage_bindings.sql")), + (Self::MariaDb, 15) => Some(include_str!("../../migrations/mariadb/0016_external_storage_bindings.sql")), (Self::MySql, 7) => Some(include_str!("../../migrations/mysql/0008_external_payload_deletions.sql")), (Self::MariaDb, 7) => Some(include_str!("../../migrations/mariadb/0008_external_payload_deletions.sql")), (Self::MySql, 8) => Some(include_str!("../../migrations/mysql/0009_task_ready_origin.sql")), @@ -717,8 +804,24 @@ impl Flavor { Self::MySql => json_text_bootstrap_sql(&bootstrap_sql_v11(sql)), Self::MariaDb => bootstrap_sql_v11(sql), }; - dispatch_summary_bootstrap_sql(sql) + external_storage_bootstrap_sql(dispatch_summary_bootstrap_sql(sql)) + } +} + +/// Fresh bootstrap creates final definitions directly; it cannot repeat an +/// ALTER after a lost initialization acknowledgement. Old SQL is a no-op here. +fn external_storage_bootstrap_sql(mut sql: String) -> String { + for (table, column, alter) in [ + ("runtime_external_payloads", " `storage_binding` TEXT NULL,\n", "ALTER TABLE runtime_external_payloads ADD COLUMN storage_binding TEXT NULL;"), + ("workflow_namespaces", " `external_payload_storage_generation` BIGINT NOT NULL DEFAULT 0,\n", "ALTER TABLE workflow_namespaces ADD COLUMN external_payload_storage_generation BIGINT NOT NULL DEFAULT 0;"), + ] { + if !sql.contains(alter) { continue; } + let start = sql.find(&format!("CREATE TABLE IF NOT EXISTS `{table}` (")).expect("compiled storage relation"); + let end = start + sql[start..].find(" PRIMARY KEY").expect("compiled storage primary key"); + sql.insert_str(end, column); + sql = sql.replace(alter, ""); } + sql } /// Fresh initialization can resume after any implicit DDL commit. Create the @@ -786,11 +889,12 @@ pub(super) async fn ensure_json_text(connection: &mut MySqlConnection, flavor: F let old: BTreeMap = serde_json::from_str::(&canonical(old))?.into_iter().collect(); let expected: BTreeMap = flavor.expected()?.into_iter().collect(); let actual: BTreeMap = catalog(connection).await?.into_iter().collect(); + let pre_binding: BTreeMap<_, _> = serde_json::from_str::(&canonical(flavor.earlier(storage_binding_step(flavor)).expect("retained storage predecessor").1))?.into_iter().collect(); for statement in flavor.step(12).expect("compiled json text step").split(";\n").map(str::trim) { let Some(rest) = statement.lines().find(|line| line.starts_with("ALTER TABLE `")) else { continue }; let name = rest.trim_start_matches("ALTER TABLE `").trim_end_matches('`').to_owned(); match actual.get(&name) { - found if found == expected.get(&name) => continue, + found if found == expected.get(&name) || (name == "workflow_namespaces" && found == pre_binding.get(&name)) => continue, found if found.is_some() && found == old.get(&name) => { let alter = statement[statement.find("ALTER TABLE").expect("alter")..].to_owned(); connection.execute(AssertSqlSafe(alter)).await?; @@ -851,6 +955,29 @@ pub(super) async fn ensure_command_intents(connection: &mut MySqlConnection, fla ensure_native_table(connection, flavor, command_intents_step(flavor), "dw_command_intents").await } +fn storage_binding_step(flavor: Flavor) -> i64 { + match flavor { Flavor::MySql => 16, Flavor::MariaDb => 15 } +} + +/// Each ALTER commits independently. Resume only exact old or exact new table +/// definitions; a column-name probe cannot admit unknown schema drift. +pub(super) async fn ensure_external_storage_bindings(connection: &mut MySqlConnection, flavor: Flavor) -> Result<()> { + let old: std::collections::BTreeMap<_, _> = serde_json::from_str::(&canonical(flavor.earlier(storage_binding_step(flavor)).expect("retained storage predecessor").1))?.into_iter().collect(); + let current: std::collections::BTreeMap<_, _> = flavor.expected()?.into_iter().collect(); + for (table, statement) in [ + ("runtime_external_payloads", "ALTER TABLE runtime_external_payloads ADD COLUMN storage_binding TEXT NULL;"), + ("workflow_namespaces", "ALTER TABLE workflow_namespaces ADD COLUMN external_payload_storage_generation BIGINT NOT NULL DEFAULT 0;"), + ] { + let actual: std::collections::BTreeMap<_, _> = catalog(connection).await?.into_iter().collect(); + if actual.get(table) == current.get(table) { continue; } + if actual.get(table) != old.get(table) { return Err(refuse(StatusCode::CONFLICT, "native_schema_catalog_mismatch")); } + connection.execute(statement).await?; + let after: std::collections::BTreeMap<_, _> = catalog(connection).await?.into_iter().collect(); + if after.get(table) != current.get(table) { return Err(refuse(StatusCode::CONFLICT, "native_schema_catalog_mismatch")); } + } + Ok(()) +} + fn dispatch_summary_step(flavor: Flavor) -> i64 { match flavor { Flavor::MySql => 15, Flavor::MariaDb => 14 } } @@ -1384,8 +1511,9 @@ pub(super) async fn upgrade(connect_options: MySqlConnectOptions) -> Result<(&'s // Accept that exact retained intermediate task definition too. let intermediate: Catalog = serde_json::from_str(&canonical(flavor.earlier(10).expect("retained v10 schema").1))?; let intermediate_task = intermediate.into_iter().find(|(name, _)| name == "workflow_tasks"); + let pre_binding: BTreeMap<_, _> = serde_json::from_str::(&canonical(flavor.earlier(storage_binding_step(flavor)).expect("retained storage predecessor").1))?.into_iter().collect(); let partial = actual.iter().all(|(name, ddl)| { - earlier_tables.get(name) == Some(ddl) || current.get(name) == Some(ddl) || v12.get(name) == Some(ddl) + earlier_tables.get(name) == Some(ddl) || current.get(name) == Some(ddl) || v12.get(name) == Some(ddl) || (["runtime_external_payloads", "workflow_namespaces"].contains(&name.as_str()) && pre_binding.get(name) == Some(ddl)) || name == "workflow_tasks" && intermediate_task.as_ref().is_some_and(|(_, task)| task == ddl) }) && earlier_tables .keys() @@ -1397,6 +1525,10 @@ pub(super) async fn upgrade(connect_options: MySqlConnectOptions) -> Result<(&'s // Each step's own marker update names the development engine, so it // changes nothing while the marker fences the upgrade. for version in from..flavor.version() { + if version == storage_binding_step(flavor) { + ensure_external_storage_bindings(&mut connection, flavor).await?; + continue; + } if version == dispatch_summary_step(flavor) { ensure_dispatch_summary(&mut connection, flavor).await?; continue; @@ -1619,6 +1751,21 @@ mod pool_tests; #[cfg(test)] mod tests { + + #[test] + fn storage_predecessors_keep_their_pinned_source_checksums_and_bootstrap_has_no_alters() { + for (flavor, version, pinned) in [ + (Flavor::MySql, 16, include_str!("../../migrations/mysql/0016_checksum.txt")), + (Flavor::MariaDb, 15, include_str!("../../migrations/mariadb/0015_checksum.txt")), + ] { + assert_eq!(checksum_hex(flavor.earlier(version).unwrap().0), pinned.trim()); + let sql = flavor.migration().sql.as_ref(); + assert_eq!(sql.matches("`storage_binding` TEXT NULL").count(), 1); + assert_eq!(sql.matches("`external_payload_storage_generation` BIGINT NOT NULL DEFAULT 0").count(), 1); + assert!(!sql.contains("ALTER TABLE runtime_external_payloads")); + assert!(!sql.contains("ALTER TABLE workflow_namespaces ADD COLUMN external_payload_storage_generation")); + } + } use super::*; use futures_util::FutureExt; use serde_json::{Value, json}; @@ -3014,7 +3161,7 @@ mod tests { assert_eq!(checksum_hex(Flavor::MariaDb.earlier(12).unwrap().0), include_str!("../../migrations/mariadb/0012_checksum.txt").trim()); let sql: &str = Flavor::MySql.migration().sql.as_ref(); - assert_eq!(Flavor::MySql.version(), 16); + assert_eq!(Flavor::MySql.version(), 17); assert!(!sql.contains("ALTER TABLE `activity_executions`"), "upgrade ALTERs are folded into the bootstrap"); assert!(!regex_lite::Regex::new(r"(?i)`?\w+`? json( |,)").unwrap().is_match(sql), "no json column remains"); assert_eq!(sql.matches("CHECK (json_valid(").count(), 75); @@ -3193,7 +3340,7 @@ mod tests { include_str!("../../migrations/mysql/0014_checksum.txt").trim()); assert_eq!(checksum_hex(Flavor::MariaDb.earlier(13).unwrap().0), include_str!("../../migrations/mariadb/0013_checksum.txt").trim()); - assert_eq!((Flavor::MySql.version(), Flavor::MariaDb.version()), (16, 15)); + assert_eq!((Flavor::MySql.version(), Flavor::MariaDb.version()), (17, 16)); for flavor in [Flavor::MySql, Flavor::MariaDb] { let sql: &str = flavor.migration().sql.as_ref(); assert_eq!(sql.matches("CREATE TABLE IF NOT EXISTS dw_command_intents (").count(), 1); @@ -3256,6 +3403,42 @@ mod tests { } } + #[tokio::test] + #[ignore = "requires the existing disposable mysql source suite"] + async fn qualification_storage_binding_upgrade_resumes_each_committed_alter_and_preserves_rows() { + for committed in 0..=2 { + let db = Database::new().await; + let mut connection = db.connection().await; + let flavor = Flavor::detect(&mut connection).await.unwrap(); + connection.close().await.unwrap(); + let from = storage_binding_step(flavor); + retained_version_database(&db, from).await; + let mut connection = db.connection().await; + connection.execute("UPDATE workflow_namespaces SET external_payload_storage='{\"driver\":\"local\",\"enabled\":false,\"config\":{\"uri\":\"file:///original/root\"}}' WHERE name='kept'").await.unwrap(); + connection.execute("INSERT INTO runtime_external_payloads(id,namespace,storage_uri,storage_uri_sha256,codec,sha256,size_bytes,upload_status) VALUES ('original','kept','file:///original/root/avro/aa/object','digest','avro','original-digest',17,'ready')").await.unwrap(); + if committed > 0 { + connection.execute("UPDATE dw_server_schema SET engine='rust-upgrading'").await.unwrap(); + for statement in [ + "ALTER TABLE runtime_external_payloads ADD COLUMN storage_binding TEXT NULL", + "ALTER TABLE workflow_namespaces ADD COLUMN external_payload_storage_generation BIGINT NOT NULL DEFAULT 0", + ].into_iter().take(committed) { + connection.execute(statement).await.unwrap(); + } + } + connection.close().await.unwrap(); + assert_eq!(upgrade(db.options.clone()).await.unwrap(), (flavor.name(), from, flavor.version())); + MySqlStorage::check(db.options.clone()).await.unwrap(); + let mut connection = db.connection().await; + let object: (String, String, u64, Option) = sqlx::query_as("SELECT storage_uri,sha256,size_bytes,storage_binding FROM runtime_external_payloads WHERE id='original'").fetch_one(&mut connection).await.unwrap(); + assert_eq!(object, ("file:///original/root/avro/aa/object".into(), "original-digest".into(), 17, None)); + let namespace: (String, i64) = sqlx::query_as("SELECT external_payload_storage,external_payload_storage_generation FROM workflow_namespaces WHERE name='kept'").fetch_one(&mut connection).await.unwrap(); + assert_eq!(serde_json::from_str::(&namespace.0).unwrap(), serde_json::json!({"driver":"local","enabled":false,"config":{"uri":"file:///original/root"}})); + assert_eq!(namespace.1, 0); + connection.close().await.unwrap(); + db.remove().await; + } + } + #[tokio::test] #[ignore = "requires the existing disposable mysql source suite"] async fn qualification_command_intents_upgrade_resumes() { diff --git a/rust/src/runtime/namespace_cleanup.rs b/rust/src/runtime/namespace_cleanup.rs index 1c6981615..2e3bdbb9f 100644 --- a/rust/src/runtime/namespace_cleanup.rs +++ b/rust/src/runtime/namespace_cleanup.rs @@ -17,12 +17,12 @@ //! format, an envelope, or one on a stream) refuses before changing anything, //! with PHP's answer for unavailable external payload storage. use super::external_registry::{object_bucket, uri_hash}; -use super::external_transport::{local_for, typed_error}; +use super::external_transport::typed_error; use super::retention::reference; use super::retention_payloads::native_reference; use super::transaction::Transaction; use super::{Result, RuntimeError}; -use crate::external_payload::{LocalStorage, Reference}; +use crate::external_payload::Reference; use axum::http::StatusCode; use serde_json::{Map, Value, json}; @@ -212,20 +212,6 @@ fn unsettled(name: &str) -> RuntimeError { } } -/// `ExternalPayloadStorageUnavailable` from the reference cleanup: the -/// namespace has no storage to delete an object it alone holds. -fn driver_unavailable(name: &str) -> RuntimeError { - RuntimeError::Protocol { - status: StatusCode::SERVICE_UNAVAILABLE, - response: json!({ - "message": "Namespace cleanup requires deleting external payloads, but external payload storage is unavailable.", - "reason": "external_payload_storage_driver_unavailable", - "namespace": name, - "error": "External payload storage driver is unavailable for namespace cleanup.", - }), - } -} - /// PHP wraps a failed delete in the reference cleanup in a plain /// `RuntimeException`, which Laravel answers as a server error. fn cleanup_failed() -> RuntimeError { @@ -321,99 +307,52 @@ store_methods! { if Self::scalar(DB::NAMESPACE_STREAM_REFERENCES).bind(name).bind(name).bind(name).fetch_one(&mut **tx).await? > 0 { return Err(unsettled(name)); } - let mut deletable = Vec::new(); + let mut targets: Vec<(String, Reference, Value)> = Vec::new(); for reference in references { - let uri = Self::query("SELECT storage_uri FROM runtime_external_payloads WHERE id=$1 AND namespace=$2") - .bind(&reference.reference_id) - .bind(name) - .fetch_optional(&mut **tx) - .await? - .map(|row| DB::string(&row, "storage_uri")) - .transpose()?; - if !Self::namespace_payload_retained(tx, name, &reference, uri.as_deref()).await? { - deletable.push((reference, uri)); - } + let row = Self::query("SELECT storage_uri,storage_binding FROM runtime_external_payloads WHERE id=$1 AND namespace=$2") + .bind(&reference.reference_id).bind(name).fetch_optional(&mut **tx).await?; + let uri = row.as_ref().map(|row| DB::string(row, "storage_uri")).transpose()?; + if Self::namespace_payload_retained(tx, name, &reference, uri.as_deref()).await? { continue; } + let row = row.ok_or_else(super::external_storage_binding::unavailable)?; + let uri = uri.expect("registered payload has a URI"); + let stored = DB::optional_string(&row, "storage_binding")?; + let policy = Self::bound_deletion_policy(tx, name, &reference, &uri, stored.as_deref()).await?; + if !targets.iter().any(|(known, _, _)| *known == uri) { targets.push((uri, reference, policy)); } } - let (policy, local) = Self::namespace_storage(tx, name).await?; + targets.sort_by(|left, right| (object_bucket(&left.0), &left.0).cmp(&(object_bucket(&right.0), &right.0))); let mut staged = Vec::new(); let mut external_payloads = 0; - if !deletable.is_empty() { - let local = match &local { - Ok(Some(local)) => local, - Ok(None) => return Err(driver_unavailable(name)), - Err(_) => return Err(cleanup_failed()), - }; - let mut targets: Vec<(String, Reference)> = Vec::new(); - for (reference, uri) in deletable { - // A reference without a registration names its object by the - // driver's address, as PHP's stored reference names its URI. - let uri = match uri { - Some(uri) => uri, - None => local.uri_for(&reference).map_err(|_| cleanup_failed())?, - }; - if !targets.iter().any(|(known, _)| *known == uri) { - targets.push((uri, reference)); - } - } - targets.sort_by(|left, right| (object_bucket(&left.0), &left.0).cmp(&(object_bucket(&right.0), &right.0))); - for (uri, reference) in targets { - Self::payload_object_lock(tx, &uri).await?; - if Self::namespace_payload_retained(tx, name, &reference, Some(&uri)).await? { - continue; - } - let owners = Self::payload_owners(tx, &uri).await?; - let own = owners.iter().find(|(_, namespace)| namespace == name).map(|(id, _)| id.clone()); - if owners.is_empty() || (own.is_some() && owners.len() == 1) { - staged.push(Self::stage_payload_deletion(tx, name, &uri, &policy).await.map_err(|_| cleanup_failed())?); - } - if let Some(id) = own { - Self::query("DELETE FROM runtime_external_payloads WHERE id=$1").bind(&id).execute(&mut **tx).await?; - } - external_payloads += 1; + for (uri, reference, policy) in targets { + Self::payload_object_lock(tx, &uri).await?; + if Self::namespace_payload_retained(tx, name, &reference, Some(&uri)).await? { continue; } + let owners = Self::payload_owners(tx, &uri).await?; + let own = owners.iter().find(|(_, namespace)| namespace == name).map(|(id, _)| id.clone()); + if owners.is_empty() || (own.is_some() && owners.len() == 1) { + staged.push(Self::stage_payload_deletion(tx, name, &uri, &policy).await.map_err(|_| cleanup_failed())?); } + if let Some(id) = own { Self::query("DELETE FROM runtime_external_payloads WHERE id=$1").bind(id).execute(&mut **tx).await?; } + external_payloads += 1; } - let mut left = Vec::new(); - for row in Self::query("SELECT id,storage_uri FROM runtime_external_payloads WHERE namespace=$1 ORDER BY id") - .bind(name) - .fetch_all(&mut **tx) - .await? - { - left.push((DB::string(&row, "id")?, DB::string(&row, "storage_uri")?)); - } + let left = Self::query("SELECT * FROM runtime_external_payloads WHERE namespace=$1 ORDER BY id") + .bind(name).fetch_all(&mut **tx).await?; let mut registrations = 0; - for (id, uri) in left { - Self::payload_object_lock(tx, &uri).await?; - let owners = Self::payload_owners(tx, &uri).await?; + for row in left { + let registered = Self::payload_row(&row)?; + let uri = ®istered.uri; + Self::payload_object_lock(tx, uri).await?; + let owners = Self::payload_owners(tx, uri).await?; if owners.len() == 1 { - if !matches!(local, Ok(Some(_))) { - return Err(registry_unavailable("External payload storage is unavailable for namespace cleanup.")); - } - let deletion = Self::stage_payload_deletion(tx, name, &uri, &policy) - .await - .map_err(|_| registry_unavailable("External payload storage could not complete namespace cleanup."))?; - staged.push(deletion); + let stored = DB::optional_string(&row, "storage_binding")?; + let policy = Self::bound_deletion_policy(tx, name, ®istered.reference, uri, stored.as_deref()).await?; + staged.push(Self::stage_payload_deletion(tx, name, uri, &policy).await + .map_err(|_| registry_unavailable("External payload storage could not complete namespace cleanup."))?); } - Self::query("DELETE FROM runtime_external_payloads WHERE id=$1").bind(&id).execute(&mut **tx).await?; + Self::query("DELETE FROM runtime_external_payloads WHERE id=$1").bind(®istered.reference.reference_id).execute(&mut **tx).await?; registrations += 1; } Ok(([external_payloads, registrations], staged)) } - /// The namespace's storage policy, saved with each recorded deletion, and - /// its enabled local storage as `driverFor` resolves it. - async fn namespace_storage(tx: &mut Transaction<'_, DB>, name: &str) -> Result<(Value, Result>)> { - let policy = Self::query("SELECT external_payload_storage FROM workflow_namespaces WHERE name=$1") - .bind(name) - .fetch_optional(&mut **tx) - .await? - .map(|row| DB::optional_document_row(&row, "external_payload_storage")) - .transpose()? - .flatten() - .unwrap_or(Value::Null); - let local = local_for(&policy, name).await; - Ok((policy, local)) - } - /// Every namespace's registration of an object: id and namespace. async fn payload_owners(tx: &mut Transaction<'_, DB>, uri: &str) -> Result> { let mut owners = Vec::new(); diff --git a/rust/src/runtime/namespaces.rs b/rust/src/runtime/namespaces.rs index 03aecd39e..c24938a98 100644 --- a/rust/src/runtime/namespaces.rs +++ b/rust/src/runtime/namespaces.rs @@ -158,19 +158,19 @@ where } pub(super) async fn set_external_policy(&self, name: &str, body: Value) -> Result { - let policy = super::external_transport::local_policy(body)?; + let explicit_location = body.get("config").and_then(|config| config.get("uri")) + .is_some_and(|uri| !uri.is_null() && uri != ""); + let mut policy = super::external_transport::local_policy(body)?; let name = name.to_ascii_lowercase(); let mut tx = self.begin().await?; - if Self::scalar("SELECT COUNT(*) FROM workflow_namespaces WHERE name=$1") - .bind(&name) - .fetch_one(&mut *tx) - .await? - == 0 - { - return Err(refuse(StatusCode::NOT_FOUND, "namespace_not_found")); + let (original, generation) = Self::external_storage_policy(&mut tx, &name).await?; + if policy["enabled"] == false && !explicit_location && original["driver"] == "local" { + if let Some(config) = original.get("config") { policy["config"] = config.clone(); } } - Self::query("UPDATE workflow_namespaces SET external_payload_storage=$1,updated_at=$2 WHERE name=$3") - .bind(DB::document(&policy)).bind(DB::bind_time(now())).bind(&name).execute(&mut *tx).await?; + let next = generation.checked_add(1).ok_or_else(super::external_storage_binding::unavailable)?; + Self::pin_legacy_payloads(&mut tx, &name, explicit_location.then_some((&policy, next))).await?; + Self::query("UPDATE workflow_namespaces SET external_payload_storage=$1,updated_at=$2,external_payload_storage_generation=$3 WHERE name=$4") + .bind(DB::document(&policy)).bind(DB::bind_time(now())).bind(next).bind(&name).execute(&mut *tx).await?; tx.commit().await?; self.describe_namespace(&name).await } diff --git a/rust/src/runtime/payload_cleanup.rs b/rust/src/runtime/payload_cleanup.rs index e5c9a644a..bc29aa1c9 100644 --- a/rust/src/runtime/payload_cleanup.rs +++ b/rust/src/runtime/payload_cleanup.rs @@ -20,7 +20,7 @@ use super::activity_completion_uploads::Context; use super::laravel_validation::{Rule, failure_messages, rule_errors}; use super::operator_metrics::whole_second; use super::store::now; -use crate::external_payload::{LocalStorage, REFERENCE_SCHEMA, Reference}; +use crate::external_payload::{REFERENCE_SCHEMA, Reference}; use chrono::{DateTime, Duration, Utc}; use serde_json::{Value, json}; @@ -74,7 +74,6 @@ store_methods! { &self, limit: i64, retention_seconds: i64, - local: Option<&LocalStorage>, ) -> Result { let limit = limit.clamp(1, MAX_BATCH_SIZE); let cutoff = now(); @@ -91,7 +90,7 @@ store_methods! { let mut report = Report::default(); for candidate in &candidates { report.processed += 1; - match self.cleanup_reference(&DB::string(candidate, "id")?, cutoff, local).await? { + match self.cleanup_reference(&DB::string(candidate, "id")?, cutoff).await? { Outcome::Skipped => report.skipped += 1, Outcome::DeletedObject => { report.deleted_references += 1; @@ -181,7 +180,7 @@ store_methods! { } /// `cleanupReference`, under the reference's object lock. - async fn cleanup_reference(&self, id: &str, cutoff: DateTime, local: Option<&LocalStorage>) -> Result { + async fn cleanup_reference(&self, id: &str, cutoff: DateTime) -> Result { let Some(first) = Self::query("SELECT storage_uri FROM runtime_external_payloads WHERE id=$1") .bind(id) .fetch_optional(&self.pool) @@ -224,9 +223,21 @@ store_methods! { size_bytes: DB::number(&row, "size_bytes")?, sha256: DB::string(&row, "sha256")?, }; - let Some(local) = local.filter(|local| local.uri_for(&reference).is_ok_and(|current| current == uri)) else { - tx.commit().await?; - return Ok(Outcome::Blocked); + let stored = DB::optional_string(&row, "storage_binding")?; + let binding = match Self::retained_storage_binding(&mut tx, self.namespace.as_ref(), &reference, &uri, stored.as_deref()).await { + Ok(binding) => binding, + Err(super::RuntimeError::Refused { reason: "external_payload_storage_binding_unavailable", .. }) => { + tx.commit().await?; + return Ok(Outcome::Blocked); + } + Err(error) => return Err(error), + }; + let local = match binding.storage().await { + Ok(local) => local, + Err(_) => { + tx.commit().await?; + return Ok(Outcome::StorageFailure); + } }; if Self::locked_backup_hold(&mut tx).await?.active() { tx.commit().await?; diff --git a/rust/src/runtime/payload_deletions.rs b/rust/src/runtime/payload_deletions.rs index bd00c7f0b..b27c13807 100644 --- a/rust/src/runtime/payload_deletions.rs +++ b/rust/src/runtime/payload_deletions.rs @@ -14,8 +14,9 @@ //! the pruned references. The cleanup and retention passes retry pending //! deletions first (`retry_payload_deletions`), least recently tried first; //! a cleanup pass also retries those of deleted namespaces. -//! A deletion keeps the namespace's storage policy from when it was -//! recorded, so a deleted namespace is still reclaimed. +//! A deletion keeps the object's original storage binding, so later policy +//! changes and namespace deletion cannot redirect reclamation. Older journals +//! retain their saved policy and require that original root to remain present. //! //! A new registration of the object, in any namespace, fences an older //! deletion: the row goes and the object stays. PHP also scans its retained @@ -26,7 +27,7 @@ //! only way a retained reference can reach it again. use super::Result; use super::external_registry::uri_hash; -use super::external_transport::local_for; +use super::external_storage_binding::deletion_storage; use super::store::now; use super::transaction::Transaction; use axum::http::StatusCode; @@ -130,8 +131,8 @@ store_methods! { .await?; if registered == 0 { let namespace = DB::string(&row, "namespace")?; - let policy: Value = serde_json::from_str(&DB::string(&row, "storage_policy")?).unwrap_or(Value::Null); - let failure = match local_for(&policy, &namespace).await { + let policy = DB::string(&row, "storage_policy")?; + let failure = match deletion_storage(&policy, &namespace, &uri).await { Ok(Some(local)) => { // Locked through the delete, as PHP's `deleting()` holds it. if Self::locked_backup_hold(&mut tx).await?.active() { diff --git a/rust/src/runtime/postgres-catalog.sql b/rust/src/runtime/postgres-catalog.sql index ecf7be268..47ad5d32b 100644 --- a/rust/src/runtime/postgres-catalog.sql +++ b/rust/src/runtime/postgres-catalog.sql @@ -12,9 +12,11 @@ SELECT kind, name, definition FROM ( WHERE n.nspname='public' AND c.relkind IN ('r','p','v','m','f','S') UNION ALL -- Historical PHP takeovers can leave dropped tail-column slots. The new - -- native readiness column has a stable name key; all old ordinal keys stay exact. + -- Native additions have stable name keys; all old ordinal keys stay exact. SELECT 'column', c.relname || '.' || CASE WHEN c.relname='workflow_tasks' AND a.attname='ready_origin_at' THEN a.attname + WHEN c.relname='runtime_external_payloads' AND a.attname='storage_binding' THEN a.attname + WHEN c.relname='workflow_namespaces' AND a.attname='external_payload_storage_generation' THEN a.attname ELSE a.attnum::text END, jsonb_build_object('name', a.attname, 'type', format_type(a.atttypid,a.atttypmod), 'not_null', a.attnotnull, 'default', pg_get_expr(d.adbin,d.adrelid,false), diff --git a/rust/src/runtime/postgres.rs b/rust/src/runtime/postgres.rs index d74fbd085..83bd52afd 100644 --- a/rust/src/runtime/postgres.rs +++ b/rust/src/runtime/postgres.rs @@ -13,7 +13,7 @@ use sqlx::{ use super::{Result, refuse}; -pub const VERSION: i64 = 15; +pub const VERSION: i64 = 16; pub const CATALOG_QUERY: &str = include_str!("postgres-catalog.sql"); type Catalog = Vec<(String, String, Json)>; @@ -53,6 +53,49 @@ fn migrator() -> &'static Migrator { MIGRATOR.get_or_init(|| { let mut migrations = Migrator::with_migrations(vec![Migration::new( VERSION, + "full frozen PHP PostgreSQL schema, native worker incarnations, session holders, stream reclaim deadlines, service call deadlines, service admission counters and committed external payload deletions and task ready origins and poll expiry indexes and scoped dispatch index and bound run command contracts and task queue activity dispatch pauses and keyed command intents and bounded schedule dispatch summaries and immutable external storage bindings".into(), + MigrationType::Simple, + concat!( + include_str!("../../migrations/postgres/0003_full_schema.sql"), + "\n", + include_str!("../../migrations/postgres/0004_worker_incarnations.sql"), + "\n", + include_str!("../../migrations/postgres/0005_worker_session_holders.sql"), + "\n", + include_str!("../../migrations/postgres/0006_stream_reclaims.sql"), + "\n", + include_str!("../../migrations/postgres/0007_service_calls.sql"), + "\n", + include_str!("../../migrations/postgres/0008_external_payload_deletions.sql"), + "\n", + include_str!("../../migrations/postgres/0009_task_ready_origin.sql"), + "\n", + include_str!("../../migrations/postgres/0010_poll_expiry_indexes.sql"), + "\n", + include_str!("../../migrations/postgres/0011_scoped_dispatch_index.sql"), + "\n", + include_str!("../../migrations/postgres/0012_run_command_contracts.sql"), + "\n", + include_str!("../../migrations/postgres/0013_task_queue_pauses.sql"), + "\n", + include_str!("../../migrations/postgres/0014_command_intents.sql"), "\n", include_str!("../../migrations/postgres/0015_schedule_dispatch_summary.sql"), "\n", include_str!("../../migrations/postgres/0016_external_storage_bindings.sql") + ) + .into_sql_str(), + false, + )]); + // The caller's transaction-scoped PostgreSQL advisory lock covers + // the pre-migration recheck, ledger, DDL and marker together. + migrations.set_locking(false); + migrations + }) +} + +// Exact released schema-15 bootstrap remains an admitted predecessor. +fn retained_v15_migrator() -> &'static Migrator { + static MIGRATOR: OnceLock = OnceLock::new(); + MIGRATOR.get_or_init(|| { + let mut migrations = Migrator::with_migrations(vec![Migration::new( + 15, "full frozen PHP PostgreSQL schema, native worker incarnations, session holders, stream reclaim deadlines, service call deadlines, service admission counters and committed external payload deletions and task ready origins and poll expiry indexes and scoped dispatch index and bound run command contracts and task queue activity dispatch pauses and keyed command intents and bounded schedule dispatch summaries".into(), MigrationType::Simple, concat!( @@ -108,6 +151,7 @@ fn earlier_migration(version: i64) -> Option<(&'static Migration, &'static str)> static V13: OnceLock = OnceLock::new(); static V14: OnceLock = OnceLock::new(); match version { + 15 => retained_v15_migrator().iter().next().map(|migration| (migration, include_str!("../../migrations/postgres/0015_catalog.json"))), 14 => Some((V14.get_or_init(|| Migration::new( 14, "full frozen PHP PostgreSQL schema, native worker incarnations, session holders, stream reclaim deadlines, service call deadlines, service admission counters and committed external payload deletions and task ready origins and poll expiry indexes and scoped dispatch index and bound run command contracts and task queue activity dispatch pauses and keyed command intents".into(), @@ -307,6 +351,7 @@ fn earlier_migration(version: i64) -> Option<(&'static Migration, &'static str)> /// The step file that moves a native database from `version` to the next. fn step(version: i64) -> Option<&'static str> { match version { + 15 => Some(include_str!("../../migrations/postgres/0016_external_storage_bindings.sql")), 7 => Some(include_str!("../../migrations/postgres/0008_external_payload_deletions.sql")), 8 => Some(include_str!("../../migrations/postgres/0009_task_ready_origin.sql")), 9 => Some(include_str!("../../migrations/postgres/0010_poll_expiry_indexes.sql")), @@ -347,7 +392,7 @@ pub(super) fn native_relations_sql() -> Result { "\n", include_str!("../../migrations/postgres/0013_task_queue_pauses.sql"), "\n", - include_str!("../../migrations/postgres/0014_command_intents.sql"), "\n", include_str!("../../migrations/postgres/0015_schedule_dispatch_summary.sql") + include_str!("../../migrations/postgres/0014_command_intents.sql"), "\n", include_str!("../../migrations/postgres/0015_schedule_dispatch_summary.sql"), "\n", include_str!("../../migrations/postgres/0016_external_storage_bindings.sql") ), ) } @@ -485,7 +530,7 @@ pub(super) async fn verify(connection: &mut PgConnection) -> Result<()> { // from SQL text. It retains types, precision, defaults, indexes, foreign // keys and sequence ownership while excluding live rows/sequence values. let expected: Catalog = - serde_json::from_str(include_str!("../../migrations/postgres/0015_catalog.json"))?; + serde_json::from_str(include_str!("../../migrations/postgres/0016_catalog.json"))?; let actual = catalog(connection).await?; if actual != expected { return Err(refuse( @@ -721,6 +766,12 @@ impl PostgresStorage { #[cfg(test)] mod tests { + + #[test] + fn storage_predecessor_keeps_its_pinned_source_checksum() { + let hex: String = earlier_migration(15).unwrap().0.checksum.iter().map(|byte| format!("{byte:02x}")).collect(); + assert_eq!(hex, include_str!("../../migrations/postgres/0015_checksum.txt").trim()); + } use super::*; use futures_util::FutureExt; use sqlx::{ @@ -2021,6 +2072,33 @@ mod tests { } } + #[tokio::test] + #[ignore = "requires the existing disposable postgres source suite"] + async fn qualification_storage_binding_upgrade_preserves_unbound_objects_and_original_policy() { + let db = Database::new().await; + version_database(&db, 15).await; + let mut connection = db.connection().await; + sqlx::raw_sql("UPDATE workflow_namespaces SET external_payload_storage='{\"driver\":\"local\",\"enabled\":false,\"config\":{\"uri\":\"file:///original/root\"}}' WHERE name='kept'; +INSERT INTO runtime_external_payloads(id,namespace,storage_uri,storage_uri_sha256,codec,sha256,size_bytes,upload_status) VALUES ('original','kept','file:///original/root/avro/aa/object','digest','avro','original-digest',17,'ready');") + .execute(&mut connection).await.unwrap(); + // PostgreSQL's retained CHAR(64) digest includes padding on a raw + // String decode. Compare the exact original representation across upgrade. + let original: (String, String, i64) = sqlx::query_as("SELECT storage_uri,sha256,size_bytes FROM runtime_external_payloads WHERE id='original'").fetch_one(&mut connection).await.unwrap(); + connection.close().await.unwrap(); + refused(PostgresStorage::open(db.options.clone()).await, "native_schema_upgrade_required"); + assert_eq!(PostgresStorage::upgrade(db.options.clone()).await.unwrap(), 15); + PostgresStorage::check(db.options.clone()).await.unwrap(); + let mut connection = db.connection().await; + let object: (String, String, i64, Option) = sqlx::query_as("SELECT storage_uri,sha256,size_bytes,storage_binding FROM runtime_external_payloads WHERE id='original'").fetch_one(&mut connection).await.unwrap(); + assert_eq!(object, (original.0, original.1, original.2, None)); + let namespace: (sqlx::types::Json, i64) = sqlx::query_as("SELECT external_payload_storage,external_payload_storage_generation FROM workflow_namespaces WHERE name='kept'").fetch_one(&mut connection).await.unwrap(); + assert_eq!(namespace.0.0, serde_json::json!({"driver":"local","enabled":false,"config":{"uri":"file:///original/root"}})); + assert_eq!(namespace.1, 0); + connection.close().await.unwrap(); + assert_eq!(PostgresStorage::upgrade(db.options.clone()).await.unwrap(), VERSION); + db.remove().await; + } + #[test] fn version_13_bootstrap_keeps_its_pinned_source_checksum() { let hex: String = earlier_migration(13).unwrap().0.checksum.iter().map(|byte| format!("{byte:02x}")).collect(); diff --git a/rust/src/runtime/retention_payloads.rs b/rust/src/runtime/retention_payloads.rs index c8dd3022b..1af488880 100644 --- a/rust/src/runtime/retention_payloads.rs +++ b/rust/src/runtime/retention_payloads.rs @@ -9,9 +9,9 @@ //! an object when its payload columns name any reference registered for the //! object's URI, in any namespace, as PHP matches stored URIs. //! -//! With nothing deletable the prune needs no storage. Otherwise the -//! namespace's enabled local storage must name the objects, or the run is -//! skipped with `external_payload_storage_driver_unavailable`. Each object is +//! With nothing deletable the prune needs no storage. Otherwise each object's +//! original binding must resolve, or the run is skipped with +//! `external_payload_storage_binding_unavailable`. Each object is //! asked again under its object lock, in lock order, after the run's rows //! are deleted: a reference still held keeps it; otherwise this namespace's //! registration goes, and when no other namespace registers the object its @@ -28,22 +28,20 @@ use super::external_registry::{object_bucket, uri_hash}; use super::external_resolution::STORED_PREFIX; use super::retention::{self, Outcome}; use super::transaction::Transaction; -use crate::external_payload::{LocalStorage, Reference}; +use crate::external_payload::Reference; use serde_json::Value; /// One object to settle: its URI and the reference this run holds for it. pub(super) struct Target { uri: String, reference: Reference, + policy: Value, } /// The run's deletable objects in lock order, with the storage to delete /// them through. pub(super) struct Plan { targets: Vec, - local: Option, - /// The namespace's storage policy, saved with each recorded deletion. - policy: Value, } /// A whole column value holding native's stored reference; `None` for any @@ -75,48 +73,28 @@ store_methods! { references.push(reference); } } - let mut deletable = Vec::new(); - for reference in references { - let uri = Self::query("SELECT storage_uri FROM runtime_external_payloads WHERE id=$1 AND namespace=$2") - .bind(&reference.reference_id) - .bind(self.namespace.as_ref()) - .fetch_optional(&mut **tx) - .await? - .map(|row| DB::string(&row, "storage_uri")) - .transpose()?; - if !Self::payload_retained(tx, run_id, &reference, uri.as_deref()).await? { - deletable.push((reference, uri)); - } - } - if deletable.is_empty() { - return Ok(Ok(Plan { targets: Vec::new(), local: None, policy: Value::Null })); - } - let policy = Self::query("SELECT external_payload_storage FROM workflow_namespaces WHERE name=$1") - .bind(self.namespace.as_ref()) - .fetch_optional(&mut **tx) - .await? - .map(|row| DB::optional_document_row(&row, "external_payload_storage")) - .transpose()? - .flatten() - .unwrap_or(Value::Null); - let local = match super::external_transport::local_for(&policy, self.namespace.as_ref()).await { - Ok(Some(local)) => local, - Ok(None) => return Ok(Err(Outcome::Skipped("external_payload_storage_driver_unavailable"))), - Err(_) => return Ok(Err(Outcome::Error(retention::PAYLOAD_CLEANUP_FAILED.into()))), - }; let mut targets: Vec = Vec::new(); - for (reference, uri) in deletable { - // A reference without a registration names its object by the - // driver's address, as PHP's stored reference names its URI. - let uri = match uri { - Some(uri) => uri, - None => match local.uri_for(&reference) { - Ok(uri) => uri, - Err(_) => return Ok(Err(Outcome::Error(retention::PAYLOAD_CLEANUP_FAILED.into()))), - }, + for reference in references { + let row = Self::query("SELECT storage_uri,storage_binding FROM runtime_external_payloads WHERE id=$1 AND namespace=$2") + .bind(&reference.reference_id).bind(self.namespace.as_ref()).fetch_optional(&mut **tx).await?; + let uri = row.as_ref().map(|row| DB::string(row, "storage_uri")).transpose()?; + if Self::payload_retained(tx, run_id, &reference, uri.as_deref()).await? { continue; } + let Some(row) = row else { + return Ok(Err(Outcome::Skipped("external_payload_storage_binding_unavailable"))); + }; + let uri = uri.expect("a registered row has a URI"); + let stored = DB::optional_string(&row, "storage_binding")?; + let binding = match Self::retained_storage_binding(tx, self.namespace.as_ref(), &reference, &uri, stored.as_deref()).await { + Ok(binding) => binding, + Err(super::RuntimeError::Refused { reason: "external_payload_storage_binding_unavailable", .. }) => + return Ok(Err(Outcome::Skipped("external_payload_storage_binding_unavailable"))), + Err(error) => return Err(error), }; + if binding.storage().await.is_err() { + return Ok(Err(Outcome::Skipped("external_payload_storage_binding_unavailable"))); + } if !targets.iter().any(|target| target.uri == uri) { - targets.push(Target { uri, reference }); + targets.push(Target { uri, reference, policy: binding.deletion_policy() }); } } // `RuntimeExternalPayloadObjectLock::inLockOrder`: the transaction @@ -124,7 +102,7 @@ store_methods! { targets.sort_by(|left, right| { (object_bucket(&left.uri), &left.uri).cmp(&(object_bucket(&right.uri), &right.uri)) }); - Ok(Ok(Plan { targets, local: Some(local), policy })) + Ok(Ok(Plan { targets })) } /// `deleteReferences` over the plan, after the run's rows are deleted: @@ -138,9 +116,6 @@ store_methods! { ) -> Result<(i64, Vec)> { let mut deleted = 0; let mut staged = Vec::new(); - if plan.local.is_none() { - return Ok((0, staged)); - } for target in plan.targets { Self::payload_object_lock(tx, &target.uri).await?; if Self::payload_retained(tx, run_id, &target.reference, Some(&target.uri)).await? { @@ -159,7 +134,7 @@ store_methods! { // `deleteRegisteredUri`: the object goes when nothing else // registers it; this namespace's registration goes either way. if owners.is_empty() || (own.is_some() && owners.len() == 1) { - staged.push(Self::stage_payload_deletion(tx, self.namespace.as_ref(), &target.uri, &plan.policy).await?); + staged.push(Self::stage_payload_deletion(tx, self.namespace.as_ref(), &target.uri, &target.policy).await?); } if let Some(id) = own { Self::query("DELETE FROM runtime_external_payloads WHERE id=$1").bind(&id).execute(&mut **tx).await?; diff --git a/rust/src/runtime/schema.rs b/rust/src/runtime/schema.rs index a03e102c7..3201ede56 100644 --- a/rust/src/runtime/schema.rs +++ b/rust/src/runtime/schema.rs @@ -11,13 +11,50 @@ use tokio::sync::OnceCell; use super::{Result, refuse}; -pub(super) const VERSION: i64 = 14; +pub(super) const VERSION: i64 = 15; fn migrator() -> &'static Migrator { static MIGRATOR: OnceLock = OnceLock::new(); MIGRATOR.get_or_init(|| { Migrator::with_migrations(vec![Migration::new( VERSION, + "full frozen PHP schema, native worker incarnations, session holders, stream reclaim deadlines, service call deadlines, service admission counters and committed external payload deletions and task ready origins and poll expiry indexes and bound run command contracts and task queue activity dispatch pauses and keyed command intents and bounded schedule dispatch summaries and immutable external storage bindings".into(), + MigrationType::Simple, + concat!( + include_str!("../../migrations/sqlite/0003_full_schema.sql"), + "\n", + include_str!("../../migrations/sqlite/0004_worker_incarnations.sql"), + "\n", + include_str!("../../migrations/sqlite/0005_worker_session_holders.sql"), + "\n", + include_str!("../../migrations/sqlite/0006_stream_reclaims.sql"), + "\n", + include_str!("../../migrations/sqlite/0007_service_calls.sql"), + "\n", + include_str!("../../migrations/sqlite/0008_external_payload_deletions.sql"), + "\n", + include_str!("../../migrations/sqlite/0009_task_ready_origin.sql"), + "\n", + include_str!("../../migrations/sqlite/0010_poll_expiry_indexes.sql"), + "\n", + include_str!("../../migrations/sqlite/0011_run_command_contracts.sql"), + "\n", + include_str!("../../migrations/sqlite/0012_task_queue_pauses.sql"), + "\n", + include_str!("../../migrations/sqlite/0013_command_intents.sql"), "\n", include_str!("../../migrations/sqlite/0014_schedule_dispatch_summary.sql"), "\n", include_str!("../../migrations/sqlite/0015_external_storage_bindings.sql") + ) + .into_sql_str(), + false, + )]) + }) +} + +// Retain the exact released schema-14 bootstrap and checksum. +fn retained_v14_migrator() -> &'static Migrator { + static MIGRATOR: OnceLock = OnceLock::new(); + MIGRATOR.get_or_init(|| { + Migrator::with_migrations(vec![Migration::new( + 14, "full frozen PHP schema, native worker incarnations, session holders, stream reclaim deadlines, service call deadlines, service admission counters and committed external payload deletions and task ready origins and poll expiry indexes and bound run command contracts and task queue activity dispatch pauses and keyed command intents and bounded schedule dispatch summaries".into(), MigrationType::Simple, concat!( @@ -61,6 +98,7 @@ fn earlier_migration(version: i64) -> Option<&'static Migration> { static V12: OnceLock = OnceLock::new(); static V13: OnceLock = OnceLock::new(); match version { + 14 => retained_v14_migrator().iter().next(), 13 => Some(V13.get_or_init(|| Migration::new( 13, "full frozen PHP schema, native worker incarnations, session holders, stream reclaim deadlines, service call deadlines, service admission counters and committed external payload deletions and task ready origins and poll expiry indexes and bound run command contracts and task queue activity dispatch pauses and keyed command intents".into(), @@ -246,6 +284,7 @@ fn earlier_migration(version: i64) -> Option<&'static Migration> { /// Each ends by moving the ownership marker to its own version. fn step(version: i64) -> Option<&'static str> { match version { + 14 => Some(include_str!("../../migrations/sqlite/0015_external_storage_bindings.sql")), 7 => Some(include_str!("../../migrations/sqlite/0008_external_payload_deletions.sql")), 8 => Some(include_str!("../../migrations/sqlite/0009_task_ready_origin.sql")), 9 => Some(include_str!("../../migrations/sqlite/0010_poll_expiry_indexes.sql")), @@ -363,7 +402,7 @@ pub(super) fn native_relations_sql() -> Result { "\n", include_str!("../../migrations/sqlite/0012_task_queue_pauses.sql"), "\n", - include_str!("../../migrations/sqlite/0013_command_intents.sql"), "\n", include_str!("../../migrations/sqlite/0014_schedule_dispatch_summary.sql") + include_str!("../../migrations/sqlite/0013_command_intents.sql"), "\n", include_str!("../../migrations/sqlite/0014_schedule_dispatch_summary.sql"), "\n", include_str!("../../migrations/sqlite/0015_external_storage_bindings.sql") ), ) } @@ -492,6 +531,12 @@ pub(super) async fn bootstrap(connection: &mut SqliteConnection) -> Result<()> { #[cfg(test)] mod tests { + + #[test] + fn storage_predecessor_keeps_its_pinned_source_checksum() { + let hex: String = earlier_migration(14).unwrap().checksum.iter().map(|byte| format!("{byte:02x}")).collect(); + assert_eq!(hex, include_str!("../../migrations/sqlite/0014_checksum.txt").trim()); + } use super::*; use sqlx::{migrate::Migrate, sqlite::SqliteJournalMode}; use std::{path::Path, process::Command, time::Duration}; @@ -852,6 +897,29 @@ mod tests { connection.close().await.unwrap(); } + #[tokio::test] + async fn version_14_storage_upgrade_preserves_original_policy_and_object_rows() { + let directory = tempfile::tempdir().unwrap(); + let path = directory.path().join("v14-storage.sqlite"); + let mut connection = SqliteConnection::connect_with(&SqliteConnectOptions::new().filename(&path).create_if_missing(true)).await.unwrap(); + Migrator::with_migrations(vec![earlier_migration(14).unwrap().clone()]).run(&mut connection).await.unwrap(); + sqlx::raw_sql("INSERT INTO workflow_namespaces(name,external_payload_storage) VALUES ('kept','{\"driver\":\"local\",\"enabled\":false,\"config\":{\"uri\":\"file:///original/root\"}}'); +INSERT INTO runtime_external_payloads(id,namespace,storage_uri,storage_uri_sha256,codec,sha256,size_bytes,upload_status) VALUES ('original','kept','file:///original/root/avro/aa/object','digest','avro','original-digest',17,'ready');") + .execute(&mut connection).await.unwrap(); + let policy: String = sqlx::query_scalar("SELECT external_payload_storage FROM workflow_namespaces WHERE name='kept'").fetch_one(&mut connection).await.unwrap(); + connection.close().await.unwrap(); + assert_eq!(reason(super::super::sqlite::open(path.to_str().unwrap()).await).await, "native_schema_upgrade_required"); + let report = super::super::schema_upgrade::upgrade_sqlite(path.to_str().unwrap()).await.unwrap(); + assert_eq!(report["from_schema_version"], 14); + let pool = super::super::sqlite::open(path.to_str().unwrap()).await.unwrap(); + let namespace: (String, i64) = sqlx::query_as("SELECT external_payload_storage,external_payload_storage_generation FROM workflow_namespaces WHERE name='kept'").fetch_one(&pool).await.unwrap(); + assert_eq!(namespace, (policy, 0)); + let object: (String, String, i64, Option) = sqlx::query_as("SELECT storage_uri,sha256,size_bytes,storage_binding FROM runtime_external_payloads WHERE id='original'").fetch_one(&pool).await.unwrap(); + assert_eq!(object, ("file:///original/root/avro/aa/object".into(), "original-digest".into(), 17, None)); + pool.close().await; + assert_eq!(super::super::schema_upgrade::upgrade_sqlite(path.to_str().unwrap()).await.unwrap()["status"], "current"); + } + #[test] fn version_12_bootstrap_keeps_its_pinned_source_checksum() { let hex: String = earlier_migration(12).unwrap().checksum.iter().map(|byte| format!("{byte:02x}")).collect(); diff --git a/rust/src/runtime/signal_payloads.rs b/rust/src/runtime/signal_payloads.rs index 451a2e7f0..01f025f76 100644 --- a/rust/src/runtime/signal_payloads.rs +++ b/rust/src/runtime/signal_payloads.rs @@ -106,7 +106,7 @@ impl Runtime { let reference = Reference::validate(&value) .map_err(|_| refuse(StatusCode::UNPROCESSABLE_ENTITY, "invalid_signal_arguments"))?; let registered = self.external_payload_for_fetch(&reference).await?; - let mut snapshot = super::external_transport::local(self) + let mut snapshot = self.external_payload_storage(®istered.reference, ®istered.uri) .await? .fetch( registered.reference, diff --git a/rust/src/runtime/upgrade/takeover/mysql_journal.rs b/rust/src/runtime/upgrade/takeover/mysql_journal.rs index 94a717d97..6a21bfb4f 100644 --- a/rust/src/runtime/upgrade/takeover/mysql_journal.rs +++ b/rust/src/runtime/upgrade/takeover/mysql_journal.rs @@ -463,6 +463,7 @@ async fn finish(connection: &mut MySqlConnection, run: &Run<'_>) -> Result<()> { mysql::ensure_task_queue_pauses(connection, run.flavor).await?; mysql::ensure_command_intents(connection, run.flavor).await?; mysql::ensure_dispatch_summary(connection, run.flavor).await?; + mysql::ensure_external_storage_bindings(connection, run.flavor).await?; connection.execute(LEDGER_SQL).await?; let migration = run.flavor.migration(); let mut tx = connection.begin().await?; diff --git a/rust/tests/execution/external_payloads/cleanup.rs b/rust/tests/execution/external_payloads/cleanup.rs index 313cdd2ad..f61ee1a6f 100644 --- a/rust/tests/execution/external_payloads/cleanup.rs +++ b/rust/tests/execution/external_payloads/cleanup.rs @@ -85,7 +85,7 @@ async fn cleanup_reclaims_expired_objects_and_keeps_shared_live_and_retained_one } #[tokio::test] -async fn cleanup_respects_its_limit_a_backup_hold_and_a_disabled_policy() { +async fn cleanup_respects_its_limit_a_backup_hold_and_missing_original_storage() { let temp = tempfile::tempdir().unwrap(); let root = temp.path().join("objects"); let (database, _runtime, router) = setup(ExternalPayloadConfig::default(), &root).await; @@ -110,15 +110,19 @@ async fn cleanup_respects_its_limit_a_backup_hold_and_a_disabled_policy() { let held = status(&router).await; assert_eq!([&held["last_pass"]["status"], &held["totals"]["blocked_outcomes"]], [&json!("blocked"), &json!(1)]); - // With the policy disabled there is no driver to delete through. + // Disabling writes retains authority. A missing original root still blocks cleanup. database.execute("UPDATE runtime_external_payload_backup_hold SET expires_at='2000-01-01 00:00:00'").await; assert_eq!(policy(&router, "default", &root, false).await, StatusCode::OK); + let offline = temp.path().join("offline"); + std::fs::rename(&root, &offline).unwrap(); let (code, body) = pass(&router, json!({})).await; assert_eq!(code, StatusCode::MULTI_STATUS, "{body}"); assert_eq!(body["cleanup"]["blocked"], 1); - // Once the hold has expired and the policy is back, the object goes. - assert_eq!(policy(&router, "default", &root, true).await, StatusCode::OK); + // Restore the original storage; the write policy stays disabled. + assert!(!root.exists()); + assert!(object(&offline, remaining).exists()); + std::fs::rename(&offline, &root).unwrap(); let (code, body) = pass(&router, json!({"limit": null})).await; assert_eq!(code, StatusCode::OK, "{body}"); assert_eq!(body["cleanup"], report([1, 1, 1, 0, 0, 0, 0], 0, 100, false)); diff --git a/rust/tests/execution/external_payloads/namespace_delete.rs b/rust/tests/execution/external_payloads/namespace_delete.rs index 307173a83..1b86d52b0 100644 --- a/rust/tests/execution/external_payloads/namespace_delete.rs +++ b/rust/tests/execution/external_payloads/namespace_delete.rs @@ -61,46 +61,52 @@ async fn namespace_delete_settles_its_external_payloads() { } #[tokio::test] -async fn namespace_delete_without_storage_refuses_and_changes_nothing() { +async fn namespace_delete_without_original_storage_refuses_and_changes_nothing() { let temp = tempfile::tempdir().unwrap(); let root = temp.path().join("objects"); let (database, _runtime, router) = setup(ExternalPayloadConfig::default(), &root).await; - // A referenced object it alone holds needs the namespace's storage. + let offline = temp.path().join("offline"); + // Disabling writes preserves the binding. Losing the original root still + // refuses before any row is deleted, rather than selecting a new root. create(&router, "held").await; assert_eq!(policy(&router, "held", &root, true).await, StatusCode::OK); let sole = upload(&router, "held", "held sole").await; closed_run(&router, "held", "held-sole", &sole).await; assert_eq!(policy(&router, "held", &root, false).await, StatusCode::OK); + std::fs::rename(&root, &offline).unwrap(); let (status, body) = delete(&router, "held").await; - assert_eq!(status, StatusCode::SERVICE_UNAVAILABLE, "{body}"); - assert_eq!(body, json!({ - "message": "Namespace cleanup requires deleting external payloads, but external payload storage is unavailable.", - "reason": "external_payload_storage_driver_unavailable", "namespace": "held", - "error": "External payload storage driver is unavailable for namespace cleanup."})); - assert!(object(&root, &sole).exists()); + assert_eq!(status, StatusCode::CONFLICT, "{body}"); + assert_eq!(body["reason"], "external_payload_storage_binding_unavailable"); + assert_eq!(body["retryable"], false); + assert!(object(&offline, &sole).exists()); + assert!(!root.exists(), "cleanup must not recreate a missing original root"); assert_eq!(registered(&database, &sole).await, 1); assert_eq!(ns_request(&router, "GET", "/api/namespaces/held", "default", Value::Null).await.0, StatusCode::OK); - assert_eq!(policy(&router, "held", &root, true).await, StatusCode::OK); + std::fs::rename(&offline, &root).unwrap(); + // The policy stays disabled. Restoring original storage is sufficient. let (status, body) = delete(&router, "held").await; assert_eq!(status, StatusCode::OK, "{body}"); assert_eq!(body["deleted"]["external_payloads_deleted"], 1, "{body}"); assert!(!object(&root, &sole).exists()); - // An unreferenced upload fails in the registry's own pass, PHP's typed - // external payload error. + // The registry's unreferenced objects preserve the same refusal boundary. create(&router, "idle").await; assert_eq!(policy(&router, "idle", &root, true).await, StatusCode::OK); let unused = upload(&router, "idle", "idle unused").await; assert_eq!(policy(&router, "idle", &root, false).await, StatusCode::OK); + std::fs::rename(&root, &offline).unwrap(); let (status, body) = delete(&router, "idle").await; - assert_eq!(status, StatusCode::SERVICE_UNAVAILABLE, "{body}"); + assert_eq!(status, StatusCode::CONFLICT, "{body}"); assert_eq!(body["schema"], "durable-workflow.v2.runtime-external-payload-error.v1", "{body}"); - assert_eq!(body["reason"], "external_payload_unavailable"); - assert_eq!(body["message"], "External payload storage is unavailable for namespace cleanup."); - assert_eq!(body["retryable"], true); - assert!(object(&root, &unused).exists()); + assert_eq!(body["reason"], "external_payload_storage_binding_unavailable"); + assert_eq!(body["retryable"], false); + assert!(object(&offline, &unused).exists()); + assert!(!root.exists()); assert_eq!(registered(&database, &unused).await, 1); + std::fs::rename(&offline, &root).unwrap(); + assert_eq!(delete(&router, "idle").await.0, StatusCode::OK); + assert!(!object(&root, &unused).exists()); } #[tokio::test] diff --git a/rust/tests/execution/external_payloads/policy_changes.rs b/rust/tests/execution/external_payloads/policy_changes.rs index b48a42e52..4a14e781b 100644 --- a/rust/tests/execution/external_payloads/policy_changes.rs +++ b/rust/tests/execution/external_payloads/policy_changes.rs @@ -32,28 +32,81 @@ async fn binding(database: &TestDatabase, reference: &Value) -> Value { async fn replace_binding(database: &TestDatabase, reference: &Value, value: &Value) { let id = reference["reference_id"].as_str().unwrap(); + let encoded = (!value.is_null()).then(|| value.to_string()); match database { TestDatabase::Sqlite(directory) => { let pool = sqlx::SqlitePool::connect(&format!("sqlite://{}", directory.path().join("runtime.sqlite").display())).await.unwrap(); sqlx::query("UPDATE runtime_external_payloads SET storage_binding=$1 WHERE id=$2") - .bind(value.to_string()).bind(id).execute(&pool).await.unwrap(); + .bind(encoded).bind(id).execute(&pool).await.unwrap(); pool.close().await; } TestDatabase::Postgres { options, .. } => { let pool = sqlx::postgres::PgPoolOptions::new().connect_with(options.as_ref().clone()).await.unwrap(); sqlx::query("UPDATE runtime_external_payloads SET storage_binding=$1 WHERE id=$2") - .bind(value.to_string()).bind(id).execute(&pool).await.unwrap(); + .bind(encoded).bind(id).execute(&pool).await.unwrap(); pool.close().await; } TestDatabase::MySql { options, .. } => { let pool = sqlx::mysql::MySqlPoolOptions::new().connect_with(options.as_ref().clone()).await.unwrap(); sqlx::query("UPDATE runtime_external_payloads SET storage_binding=? WHERE id=?") - .bind(value.to_string()).bind(id).execute(&pool).await.unwrap(); + .bind(encoded).bind(id).execute(&pool).await.unwrap(); pool.close().await; } } } +#[tokio::test] +async fn legacy_rows_pin_before_a_policy_move_and_returning_to_the_old_root_keeps_generations() { + let temporary = tempfile::tempdir().unwrap(); + let original = temporary.path().join("original"); + let replacement = temporary.path().join("replacement"); + let (database, runtime, app) = setup(ExternalPayloadConfig::default(), &original).await; + let first = upload(&app, "default", "legacy original bytes").await; + let original_binding = binding(&database, &first).await; + replace_binding(&database, &first, &Value::Null).await; + assert_eq!(policy(&app, "default", &replacement, true).await, StatusCode::OK); + assert_eq!(binding(&database, &first).await, original_binding); + let second = upload(&app, "default", "replacement generation").await; + let second_binding = binding(&database, &second).await; + assert_eq!(policy(&app, "default", &original, true).await, StatusCode::OK); + let third = upload(&app, "default", "new generation at original root").await; + let third_binding = binding(&database, &third).await; + assert_eq!(third_binding["root_uri"], original_binding["root_uri"]); + assert!(third_binding["generation"].as_i64().unwrap() > second_binding["generation"].as_i64().unwrap()); + assert_eq!(binding(&database, &first).await, original_binding); + assert_eq!(binding(&database, &second).await, second_binding); + for reference in [&first, &second, &third] { + assert_eq!(fetch(&app, "default", reference).await.0, StatusCode::OK); + } + runtime.close().await; + database.remove().await; +} + +#[tokio::test] +async fn a_missing_legacy_root_refuses_policy_replacement_without_recreating_or_rebinding_it() { + let temporary = tempfile::tempdir().unwrap(); + let original = temporary.path().join("original"); + let offline = temporary.path().join("offline"); + let replacement = temporary.path().join("replacement"); + let (database, runtime, app) = setup(ExternalPayloadConfig::default(), &original).await; + let reference = upload(&app, "default", "legacy unavailable bytes").await; + let original_binding = binding(&database, &reference).await; + replace_binding(&database, &reference, &Value::Null).await; + std::fs::rename(&original, &offline).unwrap(); + assert_eq!(policy(&app, "default", &replacement, true).await, StatusCode::CONFLICT); + assert!(!original.exists()); + assert!(!replacement.exists()); + let (status, body) = ns_request(&app, "GET", "/api/namespaces/default", "default", Value::Null).await; + assert_eq!(status, StatusCode::OK, "{body}"); + assert_eq!(body["external_payload_storage"]["config"]["uri"], format!("file://{}", original.display())); + std::fs::rename(&offline, &original).unwrap(); + assert_eq!(policy(&app, "default", &replacement, true).await, StatusCode::OK); + assert_eq!(binding(&database, &reference).await, original_binding); + assert_eq!(fetch(&app, "default", &reference).await.0, StatusCode::OK); + runtime.close().await; + database.remove().await; +} + #[tokio::test] async fn disabling_new_offloads_keeps_retained_reads_and_pruning_available() { let temporary = tempfile::tempdir().unwrap(); diff --git a/rust/tests/execution/external_payloads/retention.rs b/rust/tests/execution/external_payloads/retention.rs index 9ee9d6cf3..63c3a2c13 100644 --- a/rust/tests/execution/external_payloads/retention.rs +++ b/rust/tests/execution/external_payloads/retention.rs @@ -129,7 +129,7 @@ async fn retention_deletes_objects_no_retained_run_holds() { } #[tokio::test] -async fn retention_without_storage_or_after_a_failed_delete_keeps_the_run() { +async fn retention_without_original_storage_or_after_a_failed_delete_keeps_the_run() { let temp = tempfile::tempdir().unwrap(); let root = temp.path().join("objects"); let (database, _runtime, router) = setup(ExternalPayloadConfig::default(), &root).await; @@ -141,18 +141,22 @@ async fn retention_without_storage_or_after_a_failed_delete_keeps_the_run() { inbound_stream(&database, &run).await; - // Without storage, a run with an object to delete is skipped; one whose + // Without its original storage, a run with an object to delete is skipped; one whose // objects a retained run holds needs none. The skip marks the instance's // inbound streams blocked, as PHP's `markBlocked` does. assert_eq!(policy(&router, "default", &root, false).await, StatusCode::OK); + let offline = temp.path().join("offline"); + std::fs::rename(&root, &offline).unwrap(); let (status, result) = prune(&router, "default", &run).await; assert_eq!(status, StatusCode::OK); - assert_eq!(result, json!({"run_id": run, "outcome": "skipped", "reason": "external_payload_storage_driver_unavailable"})); + assert_eq!(result, json!({"run_id": run, "outcome": "skipped", "reason": "external_payload_storage_binding_unavailable"})); assert!(kept_details(&database, &run).await); - assert_eq!(blocked(&database, &run, "external_payload_storage_driver_unavailable").await, 1); + assert_eq!(blocked(&database, &run, "external_payload_storage_binding_unavailable").await, 1); pruned(&prune(&router, "default", &first).await.1, 0); - assert_eq!(prune(&router, "default", &second).await.1["reason"], "external_payload_storage_driver_unavailable"); - assert_eq!(policy(&router, "default", &root, true).await, StatusCode::OK); + assert_eq!(prune(&router, "default", &second).await.1["reason"], "external_payload_storage_binding_unavailable"); + assert!(!root.exists()); + assert!(object(&offline, &sole).exists()); + std::fs::rename(&offline, &root).unwrap(); // An online-backup hold fails the prune: 207, and everything stays. database.execute("INSERT INTO runtime_external_payload_backup_hold(id,owner,acquired_at,expires_at) VALUES (1,'7f1c3a1e-0000-4000-8000-000000000001','2026-01-01 00:00:00','2037-01-01 00:00:00')").await; @@ -341,9 +345,12 @@ async fn a_blocked_prune_marks_its_instance_streams_until_it_completes() { database.execute(AssertSqlSafe(format!( "INSERT INTO workflow_run_summaries(id,workflow_instance_id,run_number,class,workflow_type,namespace,status,status_bucket) SELECT 'later-run',workflow_instance_id,2,'echo','echo','default','running','running' FROM workflow_runs WHERE id='{run}'"))).await; assert_eq!(policy(&router, "default", &root, false).await, StatusCode::OK); - assert_eq!(prune(&router, "default", &run).await.1["reason"], "external_payload_storage_driver_unavailable"); - assert_eq!(blocked(&database, &run, "external_payload_storage_driver_unavailable").await, 1); - assert_eq!(policy(&router, "default", &root, true).await, StatusCode::OK); + let offline = temp.path().join("offline"); + std::fs::rename(&root, &offline).unwrap(); + assert_eq!(prune(&router, "default", &run).await.1["reason"], "external_payload_storage_binding_unavailable"); + assert_eq!(blocked(&database, &run, "external_payload_storage_binding_unavailable").await, 1); + assert!(!root.exists()); + std::fs::rename(&offline, &root).unwrap(); pruned(&prune(&router, "default", &run).await.1, 1); assert_eq!(count(&database, "SELECT COUNT(*) FROM workflow_inbound_streams WHERE cleanup_blocked_at IS NULL AND cleanup_blocked_reason IS NULL AND cleanup_blocked_run_id IS NULL").await, 1, "the completed prune clears its mark and keeps the stream"); From 17144bad2b0a2a5e97815649631399da3b8436cf Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sun, 15 Nov 2026 05:22:23 +0000 Subject: [PATCH 5/9] Validate native storage additions in physical schema comparisons --- .../server-parity/mysql-schema.php | 3 +- .../server-parity/postgres-schema.php | 3 +- scripts/conformance/server-parity/schema.php | 3 +- .../server-parity/storage-binding-schema.php | 97 ++++++++++++ tests/Unit/NativeStorageBindingSchemaTest.php | 148 ++++++++++++++++++ 5 files changed, 251 insertions(+), 3 deletions(-) create mode 100644 scripts/conformance/server-parity/storage-binding-schema.php create mode 100644 tests/Unit/NativeStorageBindingSchemaTest.php diff --git a/scripts/conformance/server-parity/mysql-schema.php b/scripts/conformance/server-parity/mysql-schema.php index f886ae9af..30d811fd4 100644 --- a/scripts/conformance/server-parity/mysql-schema.php +++ b/scripts/conformance/server-parity/mysql-schema.php @@ -4,6 +4,7 @@ require_once __DIR__.'/ready-origin-schema.php'; require_once __DIR__.'/dispatch-summary-schema.php'; +require_once __DIR__.'/storage-binding-schema.php'; // Physical fixture inspection only. This is not a database backup procedure. if (! in_array($argc, [3, 4], true) || ! in_array($argv[1], ['dump', 'catalog', 'snapshot', 'compare'], true)) { @@ -109,7 +110,7 @@ function catalog(PDO $pdo): array } $pdo->exec('ROLLBACK'); $pdo = connection($argv[3]); -$native = array_values(array_filter(projectMysqlDispatchSummary(projectMysqlJsonText(projectMysqlScopedDispatch(projectMysqlReadyOrigin(catalog($pdo))), $php)), static fn (array $row): bool => ! in_array($row[0], ['dw_server_schema', '_sqlx_migrations', 'dw_task_completions', 'dw_poll_receipts', 'dw_query_cache', 'dw_worker_registration_incarnations', 'dw_worker_session_holders', 'dw_stream_reclaims', 'dw_service_call_deadlines', 'dw_service_admission_counters', 'dw_external_payload_deletions', 'dw_run_command_contracts', 'dw_task_queue_pauses', 'dw_command_intents'], true))); +$native = array_values(array_filter(projectMysqlStorageBindings(projectMysqlDispatchSummary(projectMysqlJsonText(projectMysqlScopedDispatch(projectMysqlReadyOrigin(catalog($pdo))), $php))), static fn (array $row): bool => ! in_array($row[0], ['dw_server_schema', '_sqlx_migrations', 'dw_task_completions', 'dw_poll_receipts', 'dw_query_cache', 'dw_worker_registration_incarnations', 'dw_worker_session_holders', 'dw_stream_reclaims', 'dw_service_call_deadlines', 'dw_service_admission_counters', 'dw_external_payload_deletions', 'dw_run_command_contracts', 'dw_task_queue_pauses', 'dw_command_intents'], true))); $pdo->exec('ROLLBACK'); // Native polling uses an additional index on an existing table. Retain all // original column, index and constraint definitions in the comparison. diff --git a/scripts/conformance/server-parity/postgres-schema.php b/scripts/conformance/server-parity/postgres-schema.php index 89ee1cba3..547ec9757 100644 --- a/scripts/conformance/server-parity/postgres-schema.php +++ b/scripts/conformance/server-parity/postgres-schema.php @@ -4,6 +4,7 @@ require_once __DIR__.'/ready-origin-schema.php'; require_once __DIR__.'/dispatch-summary-schema.php'; +require_once __DIR__.'/storage-binding-schema.php'; // Inspect PostgreSQL directly, without starting Laravel or either engine. // The first database in compare mode must come from the frozen PHP image. @@ -72,7 +73,7 @@ function catalog(string $database): array if ($argc !== 4) { throw new InvalidArgumentException('Compare requires two independent databases.'); } -$native = projectPostgresDispatchSummary(projectPostgresScopedDispatch(projectPostgresReadyOrigin(catalog($argv[3])))); +$native = projectPostgresStorageBindings(projectPostgresDispatchSummary(projectPostgresScopedDispatch(projectPostgresReadyOrigin(catalog($argv[3]))))); $tables = ['_sqlx_migrations', 'dw_server_schema', 'dw_task_completions', 'dw_poll_receipts', 'dw_query_cache', 'dw_worker_registration_incarnations', 'dw_worker_session_holders', 'dw_stream_reclaims', 'dw_service_call_deadlines', 'dw_service_admission_counters', 'dw_external_payload_deletions', 'dw_run_command_contracts', 'dw_task_queue_pauses', 'dw_command_intents']; $indexes = ['_sqlx_migrations_pkey', 'dw_task_completions_pkey', 'dw_poll_receipts_pkey', 'dw_workflow_tasks_poll', 'dw_query_cache_expiration', 'dw_poll_receipts_expiration', 'dw_query_cache_pkey', 'dw_worker_registration_incarnations_pkey', 'dw_worker_incarnation_authority', 'dw_worker_incarnation_retention', 'dw_worker_session_holders_pkey', 'dw_stream_reclaims_pkey', 'dw_stream_reclaims_due', 'dw_service_call_deadlines_pkey', 'dw_service_call_deadlines_due', 'dw_service_admission_counters_pkey', 'dw_service_admission_counters_expiry', 'dw_external_payload_deletions_pkey', 'dw_external_payload_deletions_uri', 'dw_external_payload_deletions_due', 'dw_run_command_contracts_pkey', 'dw_run_command_contracts_namespace', 'dw_task_queue_pauses_pkey', 'dw_command_intents_pkey', 'dw_command_intents_namespace']; $native = array_values(array_filter($native, static function (array $row) use ($tables, $indexes): bool { diff --git a/scripts/conformance/server-parity/schema.php b/scripts/conformance/server-parity/schema.php index 15cce4232..e96aa2d07 100644 --- a/scripts/conformance/server-parity/schema.php +++ b/scripts/conformance/server-parity/schema.php @@ -4,6 +4,7 @@ require_once __DIR__.'/ready-origin-schema.php'; require_once __DIR__.'/dispatch-summary-schema.php'; +require_once __DIR__.'/storage-binding-schema.php'; // Inspect two independent SQLite files without loading either runtime. // The PHP file must come from the image pinned in php-baseline.json; this @@ -40,7 +41,7 @@ function catalog(string $filename): array } $php = catalog($argv[1]); -$native = projectSqliteDispatchSummary(projectSqliteReadyOrigin(catalog($argv[2]))); +$native = projectSqliteStorageBindings(projectSqliteDispatchSummary(projectSqliteReadyOrigin(catalog($argv[2])))); $nativeOnly = ['_sqlx_migrations', 'dw_server_schema', 'dw_task_completions', 'dw_poll_receipts', 'dw_workflow_tasks_poll', 'dw_query_cache_expiration', 'dw_poll_receipts_expiration', 'dw_query_cache', 'dw_worker_registration_incarnations', 'dw_worker_incarnation_authority', 'dw_worker_incarnation_retention', 'dw_worker_session_holders', 'dw_stream_reclaims', 'dw_service_call_deadlines', 'dw_stream_reclaims_due', 'dw_service_call_deadlines_due', 'dw_service_admission_counters', 'dw_service_admission_counters_expiry', 'dw_external_payload_deletions', 'dw_external_payload_deletions_uri', 'dw_external_payload_deletions_due', 'dw_run_command_contracts', 'dw_run_command_contracts_namespace', 'dw_task_queue_pauses', 'dw_command_intents', 'dw_command_intents_namespace']; $native = array_values(array_filter($native, static fn (array $row): bool => ! in_array($row['name'], $nativeOnly, true))); if ($php !== $native) { diff --git a/scripts/conformance/server-parity/storage-binding-schema.php b/scripts/conformance/server-parity/storage-binding-schema.php new file mode 100644 index 000000000..da4e92b4b --- /dev/null +++ b/scripts/conformance/server-parity/storage-binding-schema.php @@ -0,0 +1,97 @@ + [', storage_binding TEXT NULL,', ', storage_binding ', ','], + 'workflow_namespaces' => [', external_payload_storage_generation INTEGER NOT NULL DEFAULT 0)', + ', external_payload_storage_generation ', ')'], + ]; + $found = []; + foreach ($rows as &$row) { + if ($row['type'] !== 'table' || ! isset($definitions[$row['name']])) { + continue; + } + [$definition, $column, $replacement] = $definitions[$row['name']]; + if (substr_count($row['sql'], $definition) !== 1 || substr_count($row['sql'], $column) !== 1) { + throw new RuntimeException('Native storage binding definition mismatch.'); + } + $row['sql'] = str_replace($definition, $replacement, $row['sql']); + $found[] = $row['name']; + } + unset($row); + sort($found, SORT_STRING); + if ($found !== array_keys($definitions)) { + throw new RuntimeException('Native storage binding tables missing or duplicated.'); + } + + return $rows; +} + +function projectMysqlStorageBindings(array $rows): array +{ + $definitions = [ + 'runtime_external_payloads' => ['storage_binding', [ + " `storage_binding` text COLLATE utf8mb4_unicode_ci,\n", + " `storage_binding` text DEFAULT NULL,\n", + ]], + 'workflow_namespaces' => ['external_payload_storage_generation', [ + " `external_payload_storage_generation` bigint NOT NULL DEFAULT '0',\n", + " `external_payload_storage_generation` bigint(20) NOT NULL DEFAULT 0,\n", + ]], + ]; + $found = []; + foreach ($rows as &$row) { + if (! isset($definitions[$row[0]])) { + continue; + } + [$column, $allowed] = $definitions[$row[0]]; + $matches = array_values(array_filter($allowed, static fn (string $definition): bool => + substr_count($row[1], $definition) === 1)); + if (count($matches) !== 1 || substr_count($row[1], ' `'.$column.'`') !== 1) { + throw new RuntimeException('Native storage binding definition mismatch.'); + } + $row[1] = str_replace($matches[0], '', $row[1]); + $found[] = $row[0]; + } + unset($row); + sort($found, SORT_STRING); + if ($found !== array_keys($definitions)) { + throw new RuntimeException('Native storage binding tables missing or duplicated.'); + } + + return $rows; +} + +function projectPostgresStorageBindings(array $rows): array +{ + $expected = [ + 'runtime_external_payloads.storage_binding' => ['name' => 'storage_binding', 'type' => 'text', + 'default' => null, 'identity' => '', 'not_null' => false, 'collation' => 'default', 'generated' => ''], + 'workflow_namespaces.external_payload_storage_generation' => ['name' => 'external_payload_storage_generation', + 'type' => 'bigint', 'default' => '0', 'identity' => '', 'not_null' => true, + 'collation' => null, 'generated' => ''], + ]; + $found = []; + $result = []; + foreach ($rows as $row) { + if ($row[0] !== 'column' || ! isset($expected[$row[1]])) { + $result[] = $row; + continue; + } + if ($row[2] !== $expected[$row[1]]) { + throw new RuntimeException('Native storage binding definition mismatch.'); + } + $found[] = $row[1]; + } + sort($found, SORT_STRING); + if ($found !== array_keys($expected)) { + throw new RuntimeException('Native storage binding columns missing or duplicated.'); + } + + return $result; +} diff --git a/tests/Unit/NativeStorageBindingSchemaTest.php b/tests/Unit/NativeStorageBindingSchemaTest.php new file mode 100644 index 000000000..90a20e648 --- /dev/null +++ b/tests/Unit/NativeStorageBindingSchemaTest.php @@ -0,0 +1,148 @@ + 16, 'mariadb' => 15, 'postgres' => 15] as $backend => $version) { + $path = __DIR__.'/../../rust/migrations/'.$backend.'/'; + $old = json_decode(file_get_contents($path.sprintf('%04d_catalog.json', $version)), true, flags: JSON_THROW_ON_ERROR); + $new = json_decode(file_get_contents($path.sprintf('%04d_catalog.json', $version + 1)), true, flags: JSON_THROW_ON_ERROR); + $project = $backend === 'postgres' ? 'projectPostgresStorageBindings' : 'projectMysqlStorageBindings'; + $this->assertSame($this->canonical($old, $backend), $this->canonical($project($new), $backend)); + foreach (['runtime_external_payloads', 'workflow_namespaces'] as $table) { + foreach (['type', 'default', 'nullability', 'missing', 'duplicate', 'identity'] as $mutation) { + $changed = $new; + $column = $table === 'workflow_namespaces' ? 'external_payload_storage_generation' : 'storage_binding'; + $extra = null; + foreach ($changed as $index => &$row) { + if ($backend === 'postgres') { + if ($row[0] !== 'column' || $row[1] !== $table.'.'.$column) { + continue; + } + if ($mutation === 'missing') { + unset($changed[$index]); + } elseif ($mutation === 'duplicate') { + $extra = $row; + } else { + $key = ['type' => 'type', 'default' => 'default', 'nullability' => 'not_null', 'identity' => 'identity'][$mutation]; + $row[2][$key] = ['type' => 'varchar', 'default' => '1', 'nullability' => ! $row[2]['not_null'], 'identity' => 'a'][$mutation]; + } + } elseif ($row[0] === $table) { + preg_match('/^ `'.preg_quote($column, '/').'`[^\n]+\n/m', $row[1], $match); + $definition = $match[0]; + $replacement = match ($mutation) { + 'type' => str_replace([' text ', ' bigint'], [' blob ', ' int'], $definition), + 'default' => str_replace(",\n", " DEFAULT 1,\n", $definition), + 'nullability' => str_contains($definition, ' NOT NULL') + ? str_replace(' NOT NULL', '', $definition) + : str_replace(",\n", " NOT NULL,\n", $definition), + 'missing' => '', + 'duplicate' => $definition.$definition, + 'identity' => str_replace('`'.$column.'`', '`foreign_column`', $definition), + }; + $row[1] = str_replace($definition, $replacement, $row[1]); + } + } + unset($row); + if ($extra !== null) { + $changed[] = $extra; + } + $this->refuses($project, array_values($changed)); + } + } + $unrelated = $new; + foreach ($unrelated as &$row) { + if ($backend === 'postgres' && $row[0] === 'column' && $row[1] === 'workflow_instances.1') { + $row[2]['type'] = 'bytea'; + } elseif ($backend !== 'postgres' && $row[0] === 'workflow_instances') { + $row[1] = str_replace('varchar(191)', 'varchar(190)', $row[1]); + } + } + unset($row); + $this->assertNotSame($this->canonical($old, $backend), $this->canonical($project($unrelated), $backend)); + } + } + + public function test_real_sqlite_alters_preserve_the_rest_and_refuse_changed_definitions(): void + { + $pdo = new PDO('sqlite::memory:'); + $pdo->exec('CREATE TABLE runtime_external_payloads (id TEXT, primary key (id)); CREATE TABLE workflow_namespaces (id INTEGER PRIMARY KEY)'); + $catalog = static fn (): array => $pdo->query("SELECT type,name,tbl_name,sql FROM sqlite_schema WHERE name NOT LIKE 'sqlite_%' ORDER BY type,name")->fetchAll(PDO::FETCH_ASSOC); + $old = $catalog(); + $pdo->exec('ALTER TABLE runtime_external_payloads ADD COLUMN storage_binding TEXT NULL; ALTER TABLE workflow_namespaces ADD COLUMN external_payload_storage_generation INTEGER NOT NULL DEFAULT 0'); + $new = $catalog(); + $this->assertSame($old, projectSqliteStorageBindings($new)); + foreach (['storage_binding TEXT NULL' => ['storage_binding BLOB NULL', 'storage_binding TEXT NOT NULL', 'storage_binding TEXT NULL DEFAULT 0', 'storage_binding TEXT NULL, storage_binding TEXT NULL'], + 'external_payload_storage_generation INTEGER NOT NULL DEFAULT 0' => ['external_payload_storage_generation TEXT NOT NULL DEFAULT 0', 'external_payload_storage_generation INTEGER DEFAULT 0', 'external_payload_storage_generation INTEGER NOT NULL DEFAULT 1']] as $column => $mutations) { + foreach ($mutations as $mutation) { + $changed = $new; + foreach ($changed as &$row) { + $row['sql'] = str_replace($column, $mutation, $row['sql']); + } + unset($row); + $this->refuses('projectSqliteStorageBindings', $changed); + } + } + $this->refuses('projectSqliteStorageBindings', [$new[0]]); + $this->refuses('projectSqliteStorageBindings', [...$new, $new[0]]); + } + + private function refuses(string $project, array $rows): void + { + $message = null; + try { + $project($rows); + } catch (RuntimeException $error) { + $message = $error->getMessage(); + } + $this->assertNotNull($message, 'Changed native storage metadata was hidden.'); + $this->assertStringStartsWith('Native storage binding', $message); + } + + private function canonical(array $rows, string $backend): array + { + if ($backend === 'postgres') { + foreach ($rows as &$row) { + // Retained JSON snapshots can order object keys differently. + // Preserve list order, all scalar types and every metadata value. + $row[2] = $this->metadata($row[2]); + } + unset($row); + } else { + foreach ($rows as &$row) { + // Same retained charset canonicalization as the native catalog; + // the physical comparison itself still uses actual SHOW CREATE. + $row[1] = preg_replace('/ CHARACTER SET ([A-Za-z0-9_]+)(?= COLLATE \1_)/', '', $row[1]); + } + unset($row); + } + + return $rows; + } + + private function metadata(array $value): array + { + foreach ($value as &$field) { + if (is_array($field)) { + $field = $this->metadata($field); + } + } + unset($field); + if (! array_is_list($value)) { + ksort($value, SORT_STRING); + } + + return $value; + } +} From 3f37d641ec21ea3fd6b7afe57f8f3946638951c9 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sun, 15 Nov 2026 05:29:04 +0000 Subject: [PATCH 6/9] Run storage schema controls in the required PHP qualification --- .github/workflows/phpunit-feature.yml | 2 +- tests/Unit/PhpunitFeatureWorkflowContractTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/phpunit-feature.yml b/.github/workflows/phpunit-feature.yml index 4a9182d41..07099f7c9 100644 --- a/.github/workflows/phpunit-feature.yml +++ b/.github/workflows/phpunit-feature.yml @@ -447,7 +447,7 @@ jobs: -w /app \ --entrypoint sh \ durable-workflow-server-corpus-validator \ - -lc 'set -eu; tar --no-same-owner -xf - -C /app; cp -a /app/workflow-package /workflow; php scripts/ci/prepare-release-workflow-composer-metadata.php; composer update durable-workflow/workflow --with-dependencies --minimal-changes --no-install --no-scripts --no-autoloader --no-interaction --no-progress --prefer-dist; composer install --no-interaction --no-progress --prefer-dist; git --version; vendor/bin/phpunit --version; git rev-parse --verify "$CORPUS_BASE_REF^{commit}"; php scripts/ci/check-worker-openapi-evolution.php "$CORPUS_BASE_REF"; vendor/bin/phpunit tests/Feature tests/Unit/NativeReadyOriginSchemaTest.php tests/Unit/NativeScopedDispatchSchemaTest.php tests/Unit/NativePostgresScopedDispatchSchemaTest.php tests/Unit/WorkerProtocolOpenApiContractTest.php tests/Unit/NexusContractTest.php tests/Unit/NativePublishedComposeContractTest.php tests/Unit/PublishedServerAutoSelectionTest.php tests/Unit/CodecRegressionCorpusTest.php tests/Unit/PhpunitFeatureWorkflowContractTest.php tests/Unit/OpenApiDocumentEvolutionTest.php tests/Unit/NamespaceConformanceRunnerContractTest.php tests/Unit/NamespaceRuntimeContractTest.php tests/Unit/SchedulesConformanceRunnerContractTest.php tests/Unit/SchedulesRuntimeContractTest.php tests/Unit/ServerParitySdkDirectionResponseSummaryTest.php tests/Unit/ServerParitySdkQueryTransportTest.php tests/Unit/ServerParitySdkUpdateTransportTest.php tests/Unit/ServerParityLockPressureRetryTest.php tests/Unit/ServerParityManyUpdatesRetryTest.php tests/Unit/ServerParityReadyAgeRestartDiagnosticsTest.php tests/Unit/ServerParityLargeCommandBatchesProbeTest.php --no-progress --colors=never; vendor/bin/phpunit tests/Unit/ReleaseImageContinuationTest.php tests/Unit/ReleaseImageImmutabilityGuardTest.php --no-progress --colors=never; vendor/bin/phpunit tests/Unit/ReleaseImagePublishWorkflowContractTest.php --filter test_php_security_audits_fail_before_release_publication --no-progress --colors=never; python3 scripts/ci/validate-regression-corpus.py --base-ref "$CORPUS_BASE_REF" --verify-counterfactual' + -lc 'set -eu; tar --no-same-owner -xf - -C /app; cp -a /app/workflow-package /workflow; php scripts/ci/prepare-release-workflow-composer-metadata.php; composer update durable-workflow/workflow --with-dependencies --minimal-changes --no-install --no-scripts --no-autoloader --no-interaction --no-progress --prefer-dist; composer install --no-interaction --no-progress --prefer-dist; git --version; vendor/bin/phpunit --version; git rev-parse --verify "$CORPUS_BASE_REF^{commit}"; php scripts/ci/check-worker-openapi-evolution.php "$CORPUS_BASE_REF"; vendor/bin/phpunit tests/Feature tests/Unit/NativeReadyOriginSchemaTest.php tests/Unit/NativeStorageBindingSchemaTest.php tests/Unit/NativeScopedDispatchSchemaTest.php tests/Unit/NativePostgresScopedDispatchSchemaTest.php tests/Unit/WorkerProtocolOpenApiContractTest.php tests/Unit/NexusContractTest.php tests/Unit/NativePublishedComposeContractTest.php tests/Unit/PublishedServerAutoSelectionTest.php tests/Unit/CodecRegressionCorpusTest.php tests/Unit/PhpunitFeatureWorkflowContractTest.php tests/Unit/OpenApiDocumentEvolutionTest.php tests/Unit/NamespaceConformanceRunnerContractTest.php tests/Unit/NamespaceRuntimeContractTest.php tests/Unit/SchedulesConformanceRunnerContractTest.php tests/Unit/SchedulesRuntimeContractTest.php tests/Unit/ServerParitySdkDirectionResponseSummaryTest.php tests/Unit/ServerParitySdkQueryTransportTest.php tests/Unit/ServerParitySdkUpdateTransportTest.php tests/Unit/ServerParityLockPressureRetryTest.php tests/Unit/ServerParityManyUpdatesRetryTest.php tests/Unit/ServerParityReadyAgeRestartDiagnosticsTest.php tests/Unit/ServerParityLargeCommandBatchesProbeTest.php --no-progress --colors=never; vendor/bin/phpunit tests/Unit/ReleaseImageContinuationTest.php tests/Unit/ReleaseImageImmutabilityGuardTest.php --no-progress --colors=never; vendor/bin/phpunit tests/Unit/ReleaseImagePublishWorkflowContractTest.php --filter test_php_security_audits_fail_before_release_publication --no-progress --colors=never; python3 scripts/ci/validate-regression-corpus.py --base-ref "$CORPUS_BASE_REF" --verify-counterfactual' - name: Select production image qualification for changed build inputs id: image_inputs diff --git a/tests/Unit/PhpunitFeatureWorkflowContractTest.php b/tests/Unit/PhpunitFeatureWorkflowContractTest.php index ebb0f7612..e0d4b75fd 100644 --- a/tests/Unit/PhpunitFeatureWorkflowContractTest.php +++ b/tests/Unit/PhpunitFeatureWorkflowContractTest.php @@ -43,6 +43,7 @@ public function test_phpunit_feature_remains_complete_on_public_events(): void 'name: PHPUnit feature suite', 'if: ${{ always() }}', 'vendor/bin/phpunit tests/Feature', + 'tests/Unit/NativeStorageBindingSchemaTest.php', 'tests/Unit/NexusContractTest.php', 'tests/Unit/PhpunitFeatureWorkflowContractTest.php', ] as $needle) { From 176aa90fb8f23cdaceb4437fc1a2a91351326b03 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sun, 15 Nov 2026 05:35:30 +0000 Subject: [PATCH 7/9] Rebind the reviewed PHP test command without changing Composer authority --- tests/Unit/Support/composer-sinks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/Support/composer-sinks.json b/tests/Unit/Support/composer-sinks.json index 643f29a66..db7120309 100644 --- a/tests/Unit/Support/composer-sinks.json +++ b/tests/Unit/Support/composer-sinks.json @@ -19,7 +19,7 @@ }, { "path": ".github/workflows/phpunit-feature.yml", - "line": "-lc 'set -eu; tar --no-same-owner -xf - -C /app; cp -a /app/workflow-package /workflow; php scripts/ci/prepare-release-workflow-composer-metadata.php; composer update durable-workflow/workflow --with-dependencies --minimal-changes --no-install --no-scripts --no-autoloader --no-interaction --no-progress --prefer-dist; composer install --no-interaction --no-progress --prefer-dist; git --version; vendor/bin/phpunit --version; git rev-parse --verify \"$CORPUS_BASE_REF^{commit}\"; php scripts/ci/check-worker-openapi-evolution.php \"$CORPUS_BASE_REF\"; vendor/bin/phpunit tests/Feature tests/Unit/NativeReadyOriginSchemaTest.php tests/Unit/NativeScopedDispatchSchemaTest.php tests/Unit/NativePostgresScopedDispatchSchemaTest.php tests/Unit/WorkerProtocolOpenApiContractTest.php tests/Unit/NexusContractTest.php tests/Unit/NativePublishedComposeContractTest.php tests/Unit/PublishedServerAutoSelectionTest.php tests/Unit/CodecRegressionCorpusTest.php tests/Unit/PhpunitFeatureWorkflowContractTest.php tests/Unit/OpenApiDocumentEvolutionTest.php tests/Unit/NamespaceConformanceRunnerContractTest.php tests/Unit/NamespaceRuntimeContractTest.php tests/Unit/SchedulesConformanceRunnerContractTest.php tests/Unit/SchedulesRuntimeContractTest.php tests/Unit/ServerParitySdkDirectionResponseSummaryTest.php tests/Unit/ServerParitySdkQueryTransportTest.php tests/Unit/ServerParitySdkUpdateTransportTest.php tests/Unit/ServerParityLockPressureRetryTest.php tests/Unit/ServerParityManyUpdatesRetryTest.php tests/Unit/ServerParityReadyAgeRestartDiagnosticsTest.php tests/Unit/ServerParityLargeCommandBatchesProbeTest.php --no-progress --colors=never; vendor/bin/phpunit tests/Unit/ReleaseImageContinuationTest.php tests/Unit/ReleaseImageImmutabilityGuardTest.php --no-progress --colors=never; vendor/bin/phpunit tests/Unit/ReleaseImagePublishWorkflowContractTest.php --filter test_php_security_audits_fail_before_release_publication --no-progress --colors=never; python3 scripts/ci/validate-regression-corpus.py --base-ref \"$CORPUS_BASE_REF\" --verify-counterfactual'", + "line": "-lc 'set -eu; tar --no-same-owner -xf - -C /app; cp -a /app/workflow-package /workflow; php scripts/ci/prepare-release-workflow-composer-metadata.php; composer update durable-workflow/workflow --with-dependencies --minimal-changes --no-install --no-scripts --no-autoloader --no-interaction --no-progress --prefer-dist; composer install --no-interaction --no-progress --prefer-dist; git --version; vendor/bin/phpunit --version; git rev-parse --verify \"$CORPUS_BASE_REF^{commit}\"; php scripts/ci/check-worker-openapi-evolution.php \"$CORPUS_BASE_REF\"; vendor/bin/phpunit tests/Feature tests/Unit/NativeReadyOriginSchemaTest.php tests/Unit/NativeStorageBindingSchemaTest.php tests/Unit/NativeScopedDispatchSchemaTest.php tests/Unit/NativePostgresScopedDispatchSchemaTest.php tests/Unit/WorkerProtocolOpenApiContractTest.php tests/Unit/NexusContractTest.php tests/Unit/NativePublishedComposeContractTest.php tests/Unit/PublishedServerAutoSelectionTest.php tests/Unit/CodecRegressionCorpusTest.php tests/Unit/PhpunitFeatureWorkflowContractTest.php tests/Unit/OpenApiDocumentEvolutionTest.php tests/Unit/NamespaceConformanceRunnerContractTest.php tests/Unit/NamespaceRuntimeContractTest.php tests/Unit/SchedulesConformanceRunnerContractTest.php tests/Unit/SchedulesRuntimeContractTest.php tests/Unit/ServerParitySdkDirectionResponseSummaryTest.php tests/Unit/ServerParitySdkQueryTransportTest.php tests/Unit/ServerParitySdkUpdateTransportTest.php tests/Unit/ServerParityLockPressureRetryTest.php tests/Unit/ServerParityManyUpdatesRetryTest.php tests/Unit/ServerParityReadyAgeRestartDiagnosticsTest.php tests/Unit/ServerParityLargeCommandBatchesProbeTest.php --no-progress --colors=never; vendor/bin/phpunit tests/Unit/ReleaseImageContinuationTest.php tests/Unit/ReleaseImageImmutabilityGuardTest.php --no-progress --colors=never; vendor/bin/phpunit tests/Unit/ReleaseImagePublishWorkflowContractTest.php --filter test_php_security_audits_fail_before_release_publication --no-progress --colors=never; python3 scripts/ci/validate-regression-corpus.py --base-ref \"$CORPUS_BASE_REF\" --verify-counterfactual'", "count": 2, "confinement": "Runs in the source-free corpus tool image. The feature step checks its system bundle, hashed directory and Composer selection before fresh source and dependency installation, on cold builds and cache hits.", "guards": [ From 1674c183ee412057ec42eecc5db89b4096547f98 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sun, 15 Nov 2026 05:59:42 +0000 Subject: [PATCH 8/9] Require original storage bindings during native retention parity --- .../conformance/server-parity/contract.mjs | 2 +- .../server-parity/native-divergences.json | 11 +++++++ .../retention-payloads-contract.mjs | 14 +++++++-- .../retention-payloads-probe.php | 4 ++- .../retention-external-payloads.json | 31 +++++++++++++++++++ ...verParityRetentionPayloadsContractTest.mjs | 21 +++++++++++++ 6 files changed, 79 insertions(+), 4 deletions(-) diff --git a/scripts/conformance/server-parity/contract.mjs b/scripts/conformance/server-parity/contract.mjs index 44f0f99e0..fdf95c399 100644 --- a/scripts/conformance/server-parity/contract.mjs +++ b/scripts/conformance/server-parity/contract.mjs @@ -240,7 +240,7 @@ export function checkObservation(fixture, observation, workflowId, artifacts, ta const operatorDashboardTypes = fixture.operator_dashboard_types ? checkOperatorDashboardTypes(fixture, observation, workflowId) : null; const prometheusMetrics = fixture.prometheus_metrics ? checkPrometheusMetrics(fixture, observation, workflowId) : null; const payloadCleanup = fixture.payload_cleanup ? checkPayloadCleanup(fixture, observation, workflowId) : null; - const retentionPayloads = fixture.retention_payloads ? checkRetentionPayloads(fixture, observation, workflowId) : null; + const retentionPayloads = fixture.retention_payloads ? checkRetentionPayloads(fixture, observation, workflowId, target) : null; const clusterInfo = fixture.cluster_info ? checkClusterInfo(fixture, observation, workflowId) : null; const repairPass = fixture.repair_pass ? checkRepairPass(fixture, observation, workflowId) : null; const namespaceDelete = fixture.namespace_delete ? checkNamespaceDelete(fixture, observation, workflowId) : null; diff --git a/scripts/conformance/server-parity/native-divergences.json b/scripts/conformance/server-parity/native-divergences.json index abf3f99eb..127a70eec 100644 --- a/scripts/conformance/server-parity/native-divergences.json +++ b/scripts/conformance/server-parity/native-divergences.json @@ -48,6 +48,17 @@ "published_php": "A run its own code closes (complete, fail, continue as new) leaves its open activities and timers as they are; nothing is recorded for them.", "native": "As Core workflow#1117 (Workflow 2.28.0), the close records ActivityCancelled (cancellation_reason run_closed) for each open activity and TimerCancelled for each pending timer, wait timeouts included, before the terminal event, and appends nothing after it.", "harness": "Each affected fixture section names this divergence and carries a reviewed native_expected that overlays only the changed steps of its published expected; the contracts apply it for the native target alone. PHP and embedded recordings are unchanged." + }, + { + "id": "retained-external-storage-binding", + "issue": "https://github.com/durable-workflow/server/issues/546", + "since": "native source PR #1224 (unreleased)", + "applies_to": [ + "retention-external-payloads" + ], + "published_php": "Disabling new external writes also prevents deletion through that namespace policy; a sole payload keeps its run until the policy is enabled again.", + "native": "Each admitted object retains its original validated local storage binding. Disabling new writes does not prevent retention cleanup; the sole payload and run details are deleted and a later explicit prune observes run_not_found.", + "harness": "The two named policy-change steps have exact native-only expectations. Every original PHP setup/step remains byte-equivalent as data; held and peer objects, deletion counts, cleanup inventory and final fetch are still required. No storage outage, unavailable original binding or pending cleanup is accepted as a successful deletion." } ] } diff --git a/scripts/conformance/server-parity/retention-payloads-contract.mjs b/scripts/conformance/server-parity/retention-payloads-contract.mjs index 9a906d720..d034a7a33 100644 --- a/scripts/conformance/server-parity/retention-payloads-contract.mjs +++ b/scripts/conformance/server-parity/retention-payloads-contract.mjs @@ -1,10 +1,11 @@ import assert from 'node:assert/strict'; +import {nativeDivergence} from './native-divergences.mjs'; // Reviewed external payloads of pruned runs (HistoryRetentionEnforcer::pruneRun // with ExternalPayloadRetentionCleanup::deleteForRun). Every setup answer and // step is exact; each pass names its own run. Embedded applications have no // HTTP system routes. -export function checkRetentionPayloads(fixture, observation, workflowId) { +export function checkRetentionPayloads(fixture, observation, workflowId, target) { const definition = fixture.retention_payloads; const state = observation.retention_payloads; const projection = {scope: 'retention_payloads', steps: Object.keys(definition.steps)}; @@ -23,7 +24,16 @@ export function checkRetentionPayloads(fixture, observation, workflowId) { && root.endsWith(`/${namespace}`) && root.split('/').length === 6, 'a storage root of its own'); assert.deepStrictEqual(state.setup, definition.setup, 'every upload, run and policy accepted'); assert.deepStrictEqual(Object.keys(state.steps), Object.keys(definition.steps), 'every step recorded in order'); - for (const [step, expected] of Object.entries(definition.steps)) { + // Disabling new writes no longer removes native's original storage binding. + // Keep published PHP's refusal exact, and require native's successful delete + // and subsequent run-not-found readback instead of accepting either result. + const steps = {...definition.steps}; + if (nativeDivergence(target, definition.native_divergence)) { + assert.deepStrictEqual(Object.keys(definition.native_expected), + ['storage off: sole skipped', 'storage on: sole pruned'], 'only the reviewed policy-change steps differ'); + Object.assign(steps, definition.native_expected); + } + for (const [step, expected] of Object.entries(steps)) { assert.deepStrictEqual(state.steps[step], expected, step); } return projection; diff --git a/scripts/conformance/server-parity/retention-payloads-probe.php b/scripts/conformance/server-parity/retention-payloads-probe.php index 0ffee16d9..18aca2667 100644 --- a/scripts/conformance/server-parity/retention-payloads-probe.php +++ b/scripts/conformance/server-parity/retention-payloads-probe.php @@ -109,7 +109,9 @@ function finishHttpRetentionPayloads(Client $admin, array $fixture, string $work $prune('peer-held pruned', 'mine'); $prune('peer pruned', 'theirs'); $fetch('peer-held fetched', $namespace, $mine); - // Without storage, a held payload needs no deletion; a sole one does. + // Published PHP disables access with new writes and skips the sole payload. + // Native retains its original binding, deletes it now, and the later pass + // observes run_not_found. Keep the published step names as stable labels. $state['setup']['storage_off'] = $policy($namespace, false); $prune('storage off: held pruned', 'off-1'); $prune('storage off: sole skipped', 'off-2'); diff --git a/tests/Fixtures/ServerParity/retention-external-payloads.json b/tests/Fixtures/ServerParity/retention-external-payloads.json index d2bdc8f09..23599bb1c 100644 --- a/tests/Fixtures/ServerParity/retention-external-payloads.json +++ b/tests/Fixtures/ServerParity/retention-external-payloads.json @@ -211,6 +211,37 @@ "status": 404, "reason": "external_payload_not_found" } + }, + "native_divergence": "retained-external-storage-binding", + "native_expected": { + "storage off: sole skipped": { + "status": 200, + "processed": 1, + "run": "off-2", + "result": { + "outcome": "pruned", + "external_payloads_deleted": 1 + }, + "cleanup": { + "pending": 0, + "failed": 0, + "blocked": 0 + } + }, + "storage on: sole pruned": { + "status": 200, + "processed": 1, + "run": "off-2", + "result": { + "outcome": "skipped", + "reason": "run_not_found" + }, + "cleanup": { + "pending": 0, + "failed": 0, + "blocked": 0 + } + } } }, "contract": "POST /api/system/retention/pass with run_ids (published Server 2.11.7) deletes a pruned run's external payloads in the prune's transaction. A payload only the pruned run holds loses its object and registration, and the result counts it in external_payloads_deleted; a later fetch is 404. A payload another retained run holds stays, counted 0, until the last holder goes. Two namespaces over one local root register equal bytes as one object: while the peer's run is retained this namespace's run is pruned with 0, and when the peer's run goes its registration goes but the object stays for this namespace. Without enabled storage a run whose payloads are all held is still pruned with 0, and a run with a payload to delete is skipped with external_payload_storage_driver_unavailable until storage returns. Embedded applications have no HTTP system routes." diff --git a/tests/Unit/ServerParityRetentionPayloadsContractTest.mjs b/tests/Unit/ServerParityRetentionPayloadsContractTest.mjs index 7f163eac7..fd011e8f3 100644 --- a/tests/Unit/ServerParityRetentionPayloadsContractTest.mjs +++ b/tests/Unit/ServerParityRetentionPayloadsContractTest.mjs @@ -25,6 +25,27 @@ test('the fixture deletes, keeps and skips', () => { [404, 200, 404, 200, 404]); }); +test('native cleanup retains the admitted binding after new writes are disabled', () => { + const native = observation(); + Object.assign(native.retention_payloads.steps, structuredClone(definition.native_expected)); + assert.deepStrictEqual(checkRetentionPayloads(fixture, native, id, 'rust'), + checkRetentionPayloads(fixture, observation(), id, 'php')); + assert.throws(() => checkRetentionPayloads(fixture, observation(), id, 'rust')); + assert.throws(() => checkRetentionPayloads(fixture, native, id, 'php')); + // A readback of the already deleted original run cannot count a second deletion. + const repeated = structuredClone(native); + repeated.retention_payloads.steps['storage on: sole pruned'].result = {outcome: 'pruned', external_payloads_deleted: 1}; + assert.throws(() => checkRetentionPayloads(fixture, repeated, id, 'rust')); + for (const [step, field] of [['storage off: sole skipped', 'result'], ['sole pruned', 'cleanup']]) { + const missing = structuredClone(native); + delete missing.retention_payloads.steps[step][field]; + assert.throws(() => checkRetentionPayloads(fixture, missing, id, 'rust')); + } + const retained = structuredClone(native); + retained.retention_payloads.steps['storage on: sole fetched'] = {status: 200, bytes_match: true}; + assert.throws(() => checkRetentionPayloads(fixture, retained, id, 'rust')); +}); + test('the embedded retention payloads are explicitly inapplicable', () => { checkRetentionPayloads(fixture, {mode: 'embedded', retention_payloads: {applicable: false, reason: 'embedded_has_no_http_system_routes'}}, id); assert.throws(() => checkRetentionPayloads(fixture, {mode: 'embedded', retention_payloads: {applicable: true}}, id)); From 1c4fecd1c2dc6923ccd6767d9bdb12285bd1fc14 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sun, 15 Nov 2026 06:22:59 +0000 Subject: [PATCH 9/9] Require retained bindings during namespace deletion parity --- .../conformance/server-parity/contract.mjs | 2 +- .../namespace-delete-payloads-contract.mjs | 19 ++++++++--- .../namespace-delete-payloads-probe.php | 3 +- .../server-parity/native-divergences.json | 5 +-- .../namespace-delete-payloads.json | 33 +++++++++++++++++++ ...ityNamespaceDeletePayloadsContractTest.mjs | 24 ++++++++++++++ 6 files changed, 78 insertions(+), 8 deletions(-) diff --git a/scripts/conformance/server-parity/contract.mjs b/scripts/conformance/server-parity/contract.mjs index fdf95c399..6b2359a5d 100644 --- a/scripts/conformance/server-parity/contract.mjs +++ b/scripts/conformance/server-parity/contract.mjs @@ -244,7 +244,7 @@ export function checkObservation(fixture, observation, workflowId, artifacts, ta const clusterInfo = fixture.cluster_info ? checkClusterInfo(fixture, observation, workflowId) : null; const repairPass = fixture.repair_pass ? checkRepairPass(fixture, observation, workflowId) : null; const namespaceDelete = fixture.namespace_delete ? checkNamespaceDelete(fixture, observation, workflowId) : null; - const namespaceDeletePayloads = fixture.namespace_delete_payloads ? checkNamespaceDeletePayloads(fixture, observation, workflowId) : null; + const namespaceDeletePayloads = fixture.namespace_delete_payloads ? checkNamespaceDeletePayloads(fixture, observation, workflowId, target) : null; const updateValidation = fixture.update_validation ? checkUpdateValidation(fixture, observation, workflowId, target) : null; const messageStreams = fixture.message_streams ? checkMessageStreams(fixture, observation, workflowId) : null; const workflowStreamWrites = fixture.workflow_stream_writes ? checkWorkflowStreamWrites(fixture, observation, workflowId) : null; diff --git a/scripts/conformance/server-parity/namespace-delete-payloads-contract.mjs b/scripts/conformance/server-parity/namespace-delete-payloads-contract.mjs index aec616acd..5da714f85 100644 --- a/scripts/conformance/server-parity/namespace-delete-payloads-contract.mjs +++ b/scripts/conformance/server-parity/namespace-delete-payloads-contract.mjs @@ -1,4 +1,5 @@ import assert from 'node:assert/strict'; +import {nativeDivergence} from './native-divergences.mjs'; // Reviewed external payloads of a deleted namespace (NamespaceController::destroy // over ExternalPayloadRetentionCleanup::deleteForNamespaceCleanup, then @@ -6,7 +7,7 @@ import assert from 'node:assert/strict'; // step is exact; namespace names are per run, so each delete records whether // its answer names its own namespace. Embedded applications have no HTTP // namespaces. -export function checkNamespaceDeletePayloads(fixture, observation, workflowId) { +export function checkNamespaceDeletePayloads(fixture, observation, workflowId, target) { const definition = fixture.namespace_delete_payloads; const state = observation.namespace_delete_payloads; const projection = {scope: 'namespace_delete_payloads', steps: Object.keys(definition.steps)}; @@ -23,10 +24,20 @@ export function checkNamespaceDeletePayloads(fixture, observation, workflowId) { const root = state.storage_root; assert.ok(typeof root === 'string' && /^file:\/\/\/state\/namespace-delete-payloads-[a-z0-9-]+\//.test(root) && root.endsWith(`/${namespace}`) && root.split('/').length === 6, 'a storage root of its own'); - assert.deepStrictEqual(state.setup, definition.setup, 'every upload, run and policy accepted'); + const native = nativeDivergence(target, definition.native_divergence); + const expected = native ? JSON.parse(JSON.stringify(definition.native_expected).replaceAll('{namespace}', namespace)) : {}; + // Native can finish original-object cleanup while new writes are disabled. + // The first delete removes the namespace, so enabling or deleting it again + // must return the exact missing-namespace result, not repeat cleanup. + assert.deepStrictEqual(state.setup, {...definition.setup, ...expected.setup}, 'every upload, run and policy accepted'); assert.deepStrictEqual(Object.keys(state.steps), Object.keys(definition.steps), 'every step recorded in order'); - for (const [step, expected] of Object.entries(definition.steps)) { - assert.deepStrictEqual(state.steps[step], expected, step); + if (native) { + assert.deepStrictEqual(Object.keys(expected.setup), ['storage_on'], 'only the deleted namespace policy changes'); + assert.deepStrictEqual(Object.keys(expected.steps), + ['storage off: refused', 'storage off: namespace remains', 'deleted'], 'only original deletion and its repeat differ'); + } + for (const [step, value] of Object.entries({...definition.steps, ...expected.steps})) { + assert.deepStrictEqual(state.steps[step], value, step); } return projection; } diff --git a/scripts/conformance/server-parity/namespace-delete-payloads-probe.php b/scripts/conformance/server-parity/namespace-delete-payloads-probe.php index f97ca136d..6c1c2f445 100644 --- a/scripts/conformance/server-parity/namespace-delete-payloads-probe.php +++ b/scripts/conformance/server-parity/namespace-delete-payloads-probe.php @@ -114,7 +114,8 @@ function finishHttpNamespaceDeletePayloads(Client $admin, array $fixture, string $upload($namespace, 'namespace delete unused λ'); $upload($idle, 'namespace delete idle λ'); - // An object only the namespace holds needs its storage: nothing changes. + // PHP refuses after disabling storage; native uses original object bindings + // and deletes the namespace now. Keep the original labels for both targets. $state['setup']['storage_off'] = $policy($namespace, false); $delete('storage off: refused', $namespace); $described('storage off: namespace remains', $namespace); diff --git a/scripts/conformance/server-parity/native-divergences.json b/scripts/conformance/server-parity/native-divergences.json index 127a70eec..f3bb78914 100644 --- a/scripts/conformance/server-parity/native-divergences.json +++ b/scripts/conformance/server-parity/native-divergences.json @@ -54,11 +54,12 @@ "issue": "https://github.com/durable-workflow/server/issues/546", "since": "native source PR #1224 (unreleased)", "applies_to": [ - "retention-external-payloads" + "retention-external-payloads", + "namespace-delete-payloads" ], "published_php": "Disabling new external writes also prevents deletion through that namespace policy; a sole payload keeps its run until the policy is enabled again.", "native": "Each admitted object retains its original validated local storage binding. Disabling new writes does not prevent retention cleanup; the sole payload and run details are deleted and a later explicit prune observes run_not_found.", - "harness": "The two named policy-change steps have exact native-only expectations. Every original PHP setup/step remains byte-equivalent as data; held and peer objects, deletion counts, cleanup inventory and final fetch are still required. No storage outage, unavailable original binding or pending cleanup is accepted as a successful deletion." + "harness": "The two named retention steps and three named namespace-deletion steps have exact native-only expectations. Re-enabling an already deleted namespace returns 404; shared-object and unused-registration counts remain exact. Every original PHP setup/step remains byte-equivalent as data; held and peer objects, deletion counts, cleanup inventory and final fetch are still required. No storage outage, unavailable original binding or pending cleanup is accepted as a successful deletion." } ] } diff --git a/tests/Fixtures/ServerParity/namespace-delete-payloads.json b/tests/Fixtures/ServerParity/namespace-delete-payloads.json index f2c8359f3..9a0d029ec 100644 --- a/tests/Fixtures/ServerParity/namespace-delete-payloads.json +++ b/tests/Fixtures/ServerParity/namespace-delete-payloads.json @@ -114,6 +114,39 @@ "blocked": 0 } } + }, + "native_divergence": "retained-external-storage-binding", + "native_expected": { + "setup": { + "storage_on": 404 + }, + "steps": { + "storage off: refused": { + "status": 200, + "name_matches": true, + "outcome": "deleted", + "payloads": { + "external_payloads_deleted": 1, + "runtime_external_payload_references": 2 + }, + "cleanup": { + "pending": 0, + "failed": 0, + "blocked": 0 + } + }, + "storage off: namespace remains": { + "status": 404 + }, + "deleted": { + "status": 404, + "body": { + "message": "Namespace [{namespace}] not found.", + "reason": "namespace_not_found" + }, + "namespace_matches": true + } + } } } } diff --git a/tests/Unit/ServerParityNamespaceDeletePayloadsContractTest.mjs b/tests/Unit/ServerParityNamespaceDeletePayloadsContractTest.mjs index 051702ece..51fa6cf0c 100644 --- a/tests/Unit/ServerParityNamespaceDeletePayloadsContractTest.mjs +++ b/tests/Unit/ServerParityNamespaceDeletePayloadsContractTest.mjs @@ -27,6 +27,30 @@ test('the fixture refuses without storage, then deletes and keeps', () => { assert.deepStrictEqual(steps['idle deleted'].payloads, {runtime_external_payload_references: 1}); }); +test('native deletion uses retained bindings exactly once after write policy is disabled', () => { + const native = observation(); + const expected = JSON.parse(JSON.stringify(definition.native_expected).replaceAll('{namespace}', namespace)); + Object.assign(native.namespace_delete_payloads.setup, expected.setup); + Object.assign(native.namespace_delete_payloads.steps, expected.steps); + assert.deepStrictEqual(checkNamespaceDeletePayloads(fixture, native, id, 'rust'), + checkNamespaceDeletePayloads(fixture, observation(), id, 'php')); + assert.throws(() => checkNamespaceDeletePayloads(fixture, observation(), id, 'rust')); + assert.throws(() => checkNamespaceDeletePayloads(fixture, native, id, 'php')); + for (const mutate of [ + state => { state.setup.storage_on = 200; }, + state => { state.steps['storage off: refused'].payloads.external_payloads_deleted = 0; }, + state => { state.steps['storage off: refused'].payloads.runtime_external_payload_references = 1; }, + state => { state.steps.deleted = structuredClone(state.steps['storage off: refused']); }, + state => { state.steps.deleted.namespace_matches = false; }, + state => { state.steps['peer fetched'] = {status: 404, reason: 'external_payload_not_found'}; }, + state => { state.steps['storage off: refused'].cleanup.pending = 1; }, + ]) { + const invalid = structuredClone(native); + mutate(invalid.namespace_delete_payloads); + assert.throws(() => checkNamespaceDeletePayloads(fixture, invalid, id, 'rust')); + } +}); + test('the embedded namespace delete payloads are explicitly inapplicable', () => { checkNamespaceDeletePayloads(fixture, {mode: 'embedded', namespace_delete_payloads: {applicable: false, reason: 'embedded_has_no_http_namespaces'}}, id);