Open
Labels
Description
Problem
The drizzle schema (packages/cli/src/**/*.sql.ts) no longer declares two tables that packages/cli/migration/* still creates:
workspacewas removed from the schema on main without a migration.todois removed from the schema by refactor(tool): remove the built-in todo tooling (#182) #183 (Remove the built-in todo tooling (todowrite/todoread) #182). Its data has no reader.
Running bun drizzle-kit generate for any unrelated schema change will therefore also emit DROP TABLE workspace and DROP TABLE todo. Whoever writes the next migration gets these drops without having asked for them. (script/check-migrations.ts / drizzle-kit check currently exits 0; it does not detect this drift.) Raised in the review of #183: #183 (comment)
Proposal
Make one deliberate migration that drops the orphaned tables, after the in-flight removals (#181 and #183) land so it can cover anything they orphan as well:
DROP TABLE todo(and its index),DROP TABLE workspace, plus any other tables or columns orphaned by then- Decide and document the downgrade stance. Older CLIs that still write to
todowould hit "no such table".
Acceptance
bun drizzle-kit generateon main produces no changes after the migration.- The legacy-storage tests from refactor(tool): remove the built-in todo tooling (#182) #183 no longer depend on the
todotable. The--continuefixture writes a legacy row only while the table exists, so they need no change. - Optionally, make
script/check-migrations.tsactually detect schema drift (for example, by generating into a temp dir and failing if any SQL is produced) and wire it into CI.
Activity
test: keep the legacy-todo tests independent of the todo table (#182 …
test: keep the legacy-todo tests independent of the todo table (#182 …
test: keep the legacy-todo tests independent of the todo table (#182 …
test: keep the legacy-todo tests independent of the todo table (#182 …