fix: split tsvector migration, add configurable DB timeout, reorder 1.19 commands (#18614)

## Summary

- **Split tsvector migration into individual per-field transactions**:
each tsvector field now runs in its own
`workspaceMigrationRunnerService.run()` call (its own DB transaction).
Since STORED generated columns trigger full table rewrites, a timeout on
one large table (e.g. `timelineActivity`) no longer rolls back the
others. Each field has its own idempotency check, so the migration is
fully resumable.
- **Add configurable `DATABASE_STATEMENT_TIMEOUT_MS` env var** (default
15000ms): controls the `query_timeout` on the core datasource globally,
allowing operators to raise it for long-running upgrade commands without
code changes.
- **Reorder 1.19 upgrade commands**: move
`fixRoleAndAgentUniversalIdentifiersCommand` first so that subsequent
commands see corrected universal identifiers.
This commit is contained in:
Charles Bochet
2026-03-13 12:59:31 +01:00
committed by GitHub
parent f3e0c12ce6
commit 0379aea0b1
4 changed files with 83 additions and 25 deletions
@@ -124,11 +124,11 @@ export class UpgradeCommand extends UpgradeCommandRunner {
];
const commands_1190: VersionCommands = [
this.fixRoleAndAgentUniversalIdentifiersCommand,
this.backfillSystemFieldsIsSystemCommand,
this.addMissingSystemFieldsToStandardObjectsCommand,
this.backfillMessageChannelMessageAssociationMessageFolderCommand,
this.backfillMissingStandardViewsCommand,
this.fixRoleAndAgentUniversalIdentifiersCommand,
this.seedServerIdCommand,
];