Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align Postgres workflow_id Column with Cassandra #6520

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ALTER TABLE executions ALTER workflow_id TYPE text;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update cadence/schema.sql and visibility/schema.sql to reflect these changes? During first time setup we run only the schema files, the versions are used only when an existing cluster is upgraded. The schema files should match the outcome of running all the version upgrades.


ALTER TABLE current_executions ALTER workflow_id TYPE text;

ALTER TABLE buffered_events ALTER workflow_id TYPE text;

ALTER TABLE activity_info_maps ALTER workflow_id TYPE text;

ALTER TABLE timer_info_maps ALTER workflow_id TYPE text;

ALTER TABLE child_execution_info_maps ALTER workflow_id TYPE text;

ALTER TABLE request_cancel_info_maps ALTER workflow_id TYPE text;

ALTER TABLE signal_info_maps ALTER workflow_id TYPE text;

ALTER TABLE buffered_replication_task_maps ALTER workflow_id TYPE text;

ALTER TABLE signals_requested_sets ALTER workflow_id TYPE text;
8 changes: 8 additions & 0 deletions schema/postgres/cadence/versioned/v0.6/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"CurrVersion": "0.6",
"MinCompatibleVersion": "0.6",
"Description": "update type of workflow_id to text to remove length restriction",
"SchemaUpdateCqlFiles": [
"extend_workflow_id_length.sql"
]
}
4 changes: 2 additions & 2 deletions schema/postgres/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ package postgres

// Version is the Postgres database release version
// Cadence supports both MySQL and Postgres officially, so upgrade should be perform for both MySQL and Postgres
const Version = "0.5"
const Version = "0.6"

// VisibilityVersion is the Postgres visibility database release version
// Cadence supports both MySQL and Postgres officially, so upgrade should be perform for both MySQL and Postgres
const VisibilityVersion = "0.7"
const VisibilityVersion = "0.8"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE executions_visibility ALTER workflow_id TYPE TEXT;
8 changes: 8 additions & 0 deletions schema/postgres/visibility/versioned/v0.8/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"CurrVersion": "0.8",
"MinCompatibleVersion": "0.8",
"Description": "update type of workflow_id to text to remove length restriction",
"SchemaUpdateCqlFiles": [
"extend_workflow_id_length.sql"
]
}
4 changes: 2 additions & 2 deletions tools/common/schema/updatetask_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ func (s *UpdateTaskTestSuite) TestReadSchemaDirFromEmbeddings() {
s.NoError(err)
ans, err = readSchemaDir(fsys, "0.3", "")
s.NoError(err)
s.Equal([]string{"v0.4", "v0.5"}, ans)
s.Equal([]string{"v0.4", "v0.5", "v0.6"}, ans)

fsys, err = fs.Sub(postgres.SchemaFS, "visibility/versioned")
s.NoError(err)
ans, err = readSchemaDir(fsys, "0.5", "")
s.NoError(err)
s.Equal([]string{"v0.6", "v0.7"}, ans)
s.Equal([]string{"v0.6", "v0.7", "v0.8"}, ans)
}

func (s *UpdateTaskTestSuite) TestReadManifest() {
Expand Down