Skip to content

Commit

Permalink
Update caas schema with created_time and last_updated_time
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenxia committed Dec 18, 2024
1 parent 1b1afb9 commit 209e460
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
8 changes: 8 additions & 0 deletions schema/cassandra/cadence/schema.cql
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ CREATE TYPE checksum (
);

CREATE TABLE executions (
created_time timestamp,
shard_id int,
type int, -- enum RowType { Shard, Execution, TransferTask, TimerTask, ReplicationTask, CrossClusterTask}
domain_id uuid,
Expand Down Expand Up @@ -378,6 +379,7 @@ CREATE TABLE executions (
};

CREATE TABLE history_node (
created_time timestamp,
tree_id uuid,
branch_id uuid,
node_id bigint, -- node_id: first eventID in a batch of events
Expand All @@ -391,6 +393,7 @@ CREATE TABLE history_node (
};

CREATE TABLE history_tree (
created_time timestamp,
tree_id uuid,
branch_id uuid,
ancestors list<frozen<branch_range>>,
Expand Down Expand Up @@ -418,6 +421,7 @@ CREATE TABLE tasks (

-- this table is only used for storage of mapping of domain uuid to domain name
CREATE TABLE domains (
created_time timestamp,
id uuid,
domain frozen<domain>,
config frozen<domain_config>,
Expand All @@ -427,6 +431,7 @@ CREATE TABLE domains (
};

CREATE TABLE domains_by_name_v2 (
created_time timestamp,
domains_partition int,
name text,
domain frozen<domain>,
Expand Down Expand Up @@ -486,6 +491,7 @@ INSERT INTO domains (
) IF NOT EXISTS;

CREATE TABLE queue (
created_time timestamp,
queue_type int,
message_id bigint,
message_payload blob,
Expand All @@ -495,6 +501,8 @@ CREATE TABLE queue (
};

CREATE TABLE queue_metadata (
created_time timestamp,
last_updated_time timestamp,
queue_type int,
cluster_ack_level map<text, bigint>,
version bigint,
Expand Down
8 changes: 8 additions & 0 deletions schema/cassandra/cadence/versioned/v0.39/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"CurrVersion": "0.39",
"MinCompatibleVersion": "0.39",
"Description": "Adding create time and last update time for history tables",
"SchemaUpdateCqlFiles": [
"task_list_partition_config.cql"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TYPE task_list_partition_config (
version bigint,
num_read_partitions int,
num_write_partitions int
);

ALTER TYPE task_list ADD adaptive_partition_config frozen<task_list_partition_config>;
2 changes: 1 addition & 1 deletion schema/cassandra/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package cassandra
// NOTE: whenever there is a new data base schema update, plz update the following versions

// Version is the Cassandra database release version
const Version = "0.38"
const Version = "0.39"

// VisibilityVersion is the Cassandra visibility database release version
const VisibilityVersion = "0.9"

0 comments on commit 209e460

Please sign in to comment.