From 7d6ea78a5eee49c152a2a3a558c7e3ad61e717d6 Mon Sep 17 00:00:00 2001 From: manjari Date: Tue, 24 Feb 2026 00:09:13 +0000 Subject: [PATCH 1/2] feat(entities) Adds batch dependent entity and sql schema --- entity/batch_dependent.go | 20 +++++++++++++++++++ .../storage/mysql/schema/batch_dependent.sql | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 entity/batch_dependent.go create mode 100644 extension/storage/mysql/schema/batch_dependent.sql diff --git a/entity/batch_dependent.go b/entity/batch_dependent.go new file mode 100644 index 00000000..f4c35168 --- /dev/null +++ b/entity/batch_dependent.go @@ -0,0 +1,20 @@ +package entity + +// BatchDependent represents the downstream batches that depend on a given batch. +// The object is immutable after creation. +type BatchDependent struct { + // BatchID is the globally unique identifier representing a batch. + BatchID string + // Dependents is a list of batch IDs that are dependents for this + // batch. + // + // For e.g - Consider batches - queueA/batch/1, queueA/batch/2, queueA/batch/3 + // such that - queueA/batch/2 and queueA/batch/3 depend on queueA/batch/1 + // + // In this case, the Dependents field for - + // - queueA/batch/1 will be [queueA/batch/2, queueA/batch/3] + // - queueA/batch/2 will be empty + // - queueA/batch/3 will be empty + // + Dependents []string +} diff --git a/extension/storage/mysql/schema/batch_dependent.sql b/extension/storage/mysql/schema/batch_dependent.sql new file mode 100644 index 00000000..22e3abc3 --- /dev/null +++ b/extension/storage/mysql/schema/batch_dependent.sql @@ -0,0 +1,5 @@ +CREATE TABLE IF NOT EXISTS batch_dependent ( + batch_id VARCHAR(255) NOT NULL, + dependents JSON NOT NULL, + PRIMARY KEY (batch_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; From c86d0e79d0430e6d58310ddff95b937313e20f8a Mon Sep 17 00:00:00 2001 From: manjari Date: Tue, 24 Feb 2026 02:48:17 +0000 Subject: [PATCH 2/2] gazelle --- entity/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/entity/BUILD.bazel b/entity/BUILD.bazel index 13e8326a..616ea5c2 100644 --- a/entity/BUILD.bazel +++ b/entity/BUILD.bazel @@ -4,6 +4,7 @@ go_library( name = "entity", srcs = [ "batch.go", + "batch_dependent.go", "change_provider.go", "request.go", ],