Skip to content

fix(chunter): skip legacy comment migration when domain is absent#10891

Open
ignatremizov wants to merge 1 commit into
hcengineering:developfrom
ignatremizov:fix/chunter-legacy-comment-domain
Open

fix(chunter): skip legacy comment migration when domain is absent#10891
ignatremizov wants to merge 1 commit into
hcengineering:developfrom
ignatremizov:fix/chunter-legacy-comment-domain

Conversation

@ignatremizov
Copy link
Copy Markdown
Contributor

@ignatremizov ignatremizov commented May 25, 2026

fix(chunter): skip legacy comment migration when domain is absent

Summary

Some workspaces no longer have the legacy comment storage domain, but the old Chunter migration still tries to update and move rows from it. The upgrade continues after logging the SQL error, but the migration state is not recorded, so the same missing-table operation can be retried on later upgrade passes.

This change lets migration code check whether a domain exists before running legacy table-specific cleanup. The Chunter comment migration still runs for older workspaces that have the comment table, and newer/restored workspaces skip the obsolete work cleanly.

Changes

  • Add domainExists() to the migration client.
  • Implement the migration domain check through the active storage adapter helper.
  • Make the Postgres domain helper check actual public tables instead of assuming every domain exists.
  • Keep Postgres domain listing compatible with model domain names while also reflecting actual tables.
  • Guard Chunter's legacy comment update/move/delete operations with the domain existence check.

Testing

  • git diff --cached --check
  • node common/scripts/install-run-rush.js build -t @hcengineering/model -t @hcengineering/server-tool -t @hcengineering/postgres -t @hcengineering/model-chunter

Notes

  • A fresh worktree required node common/scripts/install-run-rush.js install before the targeted build; the first build attempt failed with Rush's Link flag invalid setup error before compiling.

Allow old Chunter migrations to complete cleanly for workspaces that no longer have the legacy `comment` storage domain. The migration still runs normally when the domain exists, but workspaces created or restored after the comment-to-activity migration can now skip the obsolete table operations and record the migration state.

Changes:
- Add a migration-client `domainExists` helper backed by the active adapter.
- Make the Postgres domain helper check actual public tables instead of assuming every domain exists.
- Keep Postgres domain listing compatible with model domain names while including translated table names.
- Guard legacy `comment` update/move/delete operations in the Chunter migration.

Validation:
- git diff --cached --check
- node common/scripts/install-run-rush.js build -t @hcengineering/model -t @hcengineering/server-tool -t @hcengineering/postgres -t @hcengineering/model-chunter

Signed-off-by: Ignat Remizov <ignat@ignatremizov.com>
@huly-github-staging
Copy link
Copy Markdown

Connected to Huly®: UBERF-16481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant