refactor(THU-739): drop legacy modes table - #1186
Draft
arienemaiara wants to merge 2 commits into
Draft
Conversation
- Add migration 0026 to DROP the powersync.modes table - Remove the modesTable definition kept until the DROP landed
Semgrep Security ScanNo security issues found. |
PR Metrics
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
| @@ -0,0 +1,5 @@ | |||
| -- This Source Code Form is subject to the terms of the Mozilla Public | |||
Collaborator
There was a problem hiding this comment.
could we merge these two migration files into a single one?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
modestable and the deadchat_threads.mode_idcolumn (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 themodessync rule; this PR removes them.Changes
backend/src/db/powersync-schema.ts— removed themodesTabledefinition and thechat_threads.modeIdcolumn.backend/drizzle/0026_open_quicksilver.sql—DROP TABLE "powersync"."modes" CASCADE;backend/drizzle/0027_moaning_kat_farrell.sql—ALTER TABLE "powersync"."chat_threads" DROP COLUMN "mode_id";_journal.json/ snapshots — generated migration metadata (idx 26, 27).Do not merge until PR #1181's
thunderbolt-powersyncimage is live and the Renderpowersyncservice has been rolled off themodessync rule. Running this migration while the service still replicatespowersync.modesbreaks replication.Stacked on
THU-739/remove-mode-table-and-any-related-legacy-code(PR #1181) — retarget tomainafter that merges.Testing
bun db generateproduced two single-statement migrations;modesandchat_threads.mode_idare gone from the schema.modesTable/modeIdrefs).powersync.test.ts→ 25 pass (test DB applied both migrations; the legacy accept-and-ignore case still passes).