Skip to content

Commit e85e6d4

Browse files
committed
feat(entities) Adds batch dependent entity and sql schema
1 parent b7d8ef7 commit e85e6d4

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎entity/batch_dependent.go‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package entity
2+
3+
// BatchDependent represents the downstream batches that depend on a given batch.
4+
// The object is immutable after creation.
5+
type BatchDependent struct {
6+
// BatchID is the globally unique identifier representing a batch.
7+
BatchID string
8+
// Dependents is a list of batch IDs that are dependents for this
9+
// batch.
10+
//
11+
// For e.g - Consider batches - queueA/batch/1, queueA/batch/2, queueA/batch/3
12+
// such that - queueA/batch/2 and queueA/batch/3 depend on queueA/batch/1
13+
//
14+
// In this case, the Dependents field for -
15+
// - queueA/batch/1 will be [queueA/batch/2, queueA/batch/3]
16+
// - queueA/batch/2 will be empty
17+
// - queueA/batch/3 will be empty
18+
//
19+
Dependents []string
20+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CREATE TABLE IF NOT EXISTS batch_dependent (
2+
batch_id VARCHAR(255) NOT NULL,
3+
dependents JSON NOT NULL,
4+
PRIMARY KEY (batch_id)
5+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

0 commit comments

Comments
 (0)