Skip to content

Commit ad23a15

Browse files
committed
feat(domain multi-tenancy): Update Cassandra schema to be synced with recent IDL changes
1 parent e3f652e commit ad23a15

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed

schema/cassandra/cadence/schema.cql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ CREATE TYPE transfer_task (
134134
schedule_id bigint,
135135
version bigint, -- the failover version when this task is created, used to compare against the mutable state, in case the events got overwritten
136136
record_visibility boolean, -- indicates whether or not to create a visibility record
137+
original_task_list text, -- the original task list of the task if the task is a sticky decision task
137138
);
138139

139140
CREATE TYPE replication_task (
@@ -166,6 +167,7 @@ CREATE TYPE timer_task (
166167
event_id bigint, -- Corresponds to event ID in history that is responsible for this timer.
167168
schedule_attempt bigint, -- Used to retry failed decision tasks using mutable state
168169
version bigint, -- the failover version when this task is created, used to compare against the mutable state, in case the events got overwritten
170+
task_list text, -- the task list associated with the timer task
169171
);
170172

171173
-- Workflow activity in progress mutable state
@@ -548,7 +550,7 @@ CREATE TABLE domain_audit_log (
548550
state_after blob, -- state_after stores the domain state after the request
549551
state_after_encoding text, -- the encoding type used for state_after
550552

551-
operation_type int, -- operation_type stores the type of operation that was performed. It is deserialized as an enum and can be used to customize the serialization/deserialization strategy.
553+
operation_type int, -- operation_type stores the type of operation that was performed. It is deserialized as an enum and can be used to customize the serialization/deserialization strategy.
552554

553555
created_time timestamp, -- created_time the time this row was inserted
554556
last_updated_time timestamp,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"CurrVersion": "0.45",
3+
"MinCompatibleVersion": "0.45",
4+
"Description": "Adding original_task_list and task_list to transfer and timer tasks",
5+
"SchemaUpdateCqlFiles": [
6+
"transfer_task.cql",
7+
"timer_task.cql"
8+
]
9+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TYPE timer_task ADD task_list text;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TYPE transfer_task ADD original_task_list text;

schema/cassandra/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ package cassandra
2323
// NOTE: whenever there is a new data base schema update, plz update the following versions
2424

2525
// Version is the Cassandra database release version
26-
const Version = "0.44"
26+
const Version = "0.45"
2727

2828
// VisibilityVersion is the Cassandra visibility database release version
2929
const VisibilityVersion = "0.10"

tools/common/schema/updatetask_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (s *UpdateTaskTestSuite) TestReadSchemaDirFromEmbeddings() {
116116
s.NoError(err)
117117
ans, err := readSchemaDir(fsys, "0.30", "")
118118
s.NoError(err)
119-
s.Equal([]string{"v0.31", "v0.32", "v0.33", "v0.34", "v0.35", "v0.36", "v0.37", "v0.38", "v0.39", "v0.40", "v0.41", "v0.42", "v0.43", "v0.44"}, ans)
119+
s.Equal([]string{"v0.31", "v0.32", "v0.33", "v0.34", "v0.35", "v0.36", "v0.37", "v0.38", "v0.39", "v0.40", "v0.41", "v0.42", "v0.43", "v0.44", "v0.45"}, ans)
120120

121121
fsys, err = fs.Sub(cassandra.SchemaFS, "visibility/versioned")
122122
s.NoError(err)

0 commit comments

Comments
 (0)