Skip to content

refactor(THU-739): drop legacy modes table - #1186

Draft
arienemaiara wants to merge 2 commits into
THU-739/remove-mode-table-and-any-related-legacy-codefrom
THU-739/drop-modes-table
Draft

refactor(THU-739): drop legacy modes table#1186
arienemaiara wants to merge 2 commits into
THU-739/remove-mode-table-and-any-related-legacy-codefrom
THU-739/drop-modes-table

Conversation

@arienemaiara

@arienemaiara arienemaiara commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

What & why

THU-739, PR 2 of 2. The backend teardown for the removed chat-modes feature, now that PR #1181 stopped syncing it. Drops the modes table and the dead chat_threads.mode_id column (a FK-like reference to it; nothing reads or writes it). PR 1 kept the backend defs so the postgres objects survived until the PowerSync service rolled off the modes sync rule; this PR removes them.

Changes

  • backend/src/db/powersync-schema.ts — removed the modesTable definition and the chat_threads.modeId column.
  • backend/drizzle/0026_open_quicksilver.sqlDROP TABLE "powersync"."modes" CASCADE;
  • backend/drizzle/0027_moaning_kat_farrell.sqlALTER TABLE "powersync"."chat_threads" DROP COLUMN "mode_id";
  • _journal.json / snapshots — generated migration metadata (idx 26, 27).

⚠️ Merge gate

Do not merge until PR #1181's thunderbolt-powersync image is live and the Render powersync service has been rolled off the modes sync rule. Running this migration while the service still replicates powersync.modes breaks replication.

Stacked on THU-739/remove-mode-table-and-any-related-legacy-code (PR #1181) — retarget to main after that merges.

Testing

  • bun db generate produced two single-statement migrations; modes and chat_threads.mode_id are gone from the schema.
  • Backend type-check clean (no dangling modesTable / modeId refs).
  • powersync.test.ts → 25 pass (test DB applied both migrations; the legacy accept-and-ignore case still passes).

- Add migration 0026 to DROP the powersync.modes table
- Remove the modesTable definition kept until the DROP landed
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Semgrep Security Scan

No security issues found.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

PR Metrics

Metric Value
Lines changed (prod code) +0 / -26
JS bundle size (gzipped) 🟢 588.6 KB → 585.1 KB (-3.5 KB, -0.6%)
Test coverage 🟡 81.24% → 81.00% (-0.2%)
Performance (preview) Preview not ready — Render deploy may have timed out
Accessibility
Best Practices
SEO

Updated Tue, 04 Aug 2026 17:10:31 GMT · run #2576

- Add migration 0027 dropping the legacy mode_id column
- Remove mode_id from the powersync chat_threads schema
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