Skip to content

Chat voting: drop legacy preset columns - #408

Merged
smb merged 1 commit into
mainfrom
407-chat-voting-drop-preset
Oct 11, 2026
Merged

smb merged 1 commit into
mainfrom
407-chat-voting-drop-preset

Conversation

@smb

@smb smb commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Last slice of the chat voting rework (epic #397), after #399 and #401.

⚠️ Do not merge yet

Merge only after #401 runs in production (0046 and 0052 applied, worker deployed). The production worker before #401 still writes preset; with the column gone, starting a vote would fail.

What changes

  • Migration 0053 rebuilds chat_votes without preset and legacy_written; kind is NOT NULL and the CHECK constraints use kind only.
  • Drops the transition trigger chat_votes_fill_legacy_kind_after_insert; indexes and panel revision triggers are recreated as in 0047.
  • Approvals are backed up and restored around the rebuild (ON DELETE CASCADE), as in 0046.
  • The derived preset in memory, chat text and overlay stays.

Deploy order

Production: apply 0053 by hand, then deploy the worker. The #401 worker no longer touches the dropped columns, so applying the migration while it runs is safe.

Verification

  • pnpm run check green.
  • New migration test covers all six legacy presets, kind-only rows, approvals, NOT NULL and CHECKs.
  • Sol review over the full diff: no findings.

Closes #407

- 📊 Database:
  - Migration 0053 rebuilds chat_votes without preset and legacy_written; kind is NOT NULL
  - CHECK constraints use kind only; legacy kind trigger dropped
  - Approvals backed up and restored around the rebuild; indexes and panel revision triggers recreated
  - LATEST_SCHEMA_MIGRATION bumped to 0053
- 🧪 Tests:
  - Migration test for all six legacy presets, kind-only rows, approvals, NOT NULL and CHECKs
  - Schema fixtures and object counts updated

Refs #407
@sonarqubecloud

Copy link
Copy Markdown

@smb
smb marked this pull request as ready for review October 11, 2026 11:37
@smb
smb merged commit 07e5af9 into main Oct 11, 2026
10 of 12 checks passed
@smb
smb deleted the 407-chat-voting-drop-preset branch October 11, 2026 11:37
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.

Chat voting: drop legacy preset columns

1 participant