Skip to content

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

Draft
arienemaiara wants to merge 1 commit into
mainfrom
THU-739/drop-modes-table
Draft

refactor(THU-739): drop legacy modes table#1186
arienemaiara wants to merge 1 commit into
mainfrom
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_overconfident_silvermane.sql — one migration for both drops:
    DROP TABLE "powersync"."modes" CASCADE;
    ALTER TABLE "powersync"."chat_threads" DROP COLUMN "mode_id";
  • _journal.json / snapshot — migration metadata (idx 26).

⚠️ Merge gate

Run this migration only after the Render powersync service has been rolled onto the image from PR #1181 (sync rules no longer reference powersync.modes). Dropping the table while the service still replicates it breaks replication.

Testing

  • bun db generate → "No schema changes" (snapshot consistent, no drift).
  • Backend type-check clean (no dangling modesTable / modeId refs).
  • powersync.test.ts → 25 pass (test DB applied the migration; the legacy accept-and-ignore case still passes).

@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) 🟢 591.4 KB → 591.2 KB (-187 B, -0.0%)
Test coverage 🟢 81.38% → 81.36% (+-0.0%)
Performance (preview) Preview not ready — Render deploy may have timed out
Accessibility
Best Practices
SEO

Updated Fri, 07 Aug 2026 18:13:13 GMT · run #2630

@@ -0,0 +1,5 @@
-- This Source Code Form is subject to the terms of the Mozilla Public

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

could we merge these two migration files into a single one?

Base automatically changed from THU-739/remove-mode-table-and-any-related-legacy-code to main August 7, 2026 17:55
- Add migration 0026 dropping powersync.modes and chat_threads.mode_id
- Remove modes from backend powersync schema
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Preview environment deployed 🚀

Service URL
Marketing / blog / docs https://thunderbolt-pr-1186.preview.thunderbolt.io
App https://app-pr-1186.preview.thunderbolt.io
API https://api-pr-1186.preview.thunderbolt.io
Keycloak https://auth-pr-1186.preview.thunderbolt.io
PowerSync https://powersync-pr-1186.preview.thunderbolt.io

Stack: preview-pr-1186 · Commit: 2c8772ad8323234eda0d00f90d1baf60967a1afd

Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — demo@thunderbolt.io / demo by default.

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.

2 participants