cleanup: compact blank-start database baseline #354

Merged
barrettruth merged 1 commit from issue-307-compact-blank-baseline into main 2026-05-11 20:50:48 +00:00
Owner

Problem

Fresh databases still replayed the full historical migration chain, creating removed surfaces before later drop migrations cleaned them up. That made the blank-start schema harder to reason about after the #351/#308 retired-auth cleanup landed.

Solution

  • Replace the historical migration chain with 0000_blank_start_baseline, generated from the current single-owner schema.
  • Keep one forward migration, 0001_deployed_schema_cleanup, with a timestamp after the previous chain so already-deployed databases can drop retired tables and rebuild users without losing task/calendar/provider data.
  • Remove the now-unused invite_links schema export from the active schema.
  • Expand schema migration tests to cover the fresh compact baseline, retired surface absence, Drizzle schema drift, and the deployed-database cleanup path.

This PR is based on current main after #351/#308, not the old stacked branch.

Verification

  • nix develop --command pnpm exec vitest run tests/core/schema.test.ts tests/core/auth.test.ts tests/api/auth.test.ts tests/core/integration-config.test.ts tests/core/external-links.test.ts --reporter=verbose
  • nix develop --command pnpm exec drizzle-kit generate --schema ./src/db/schema.ts --out ./drizzle --dialect sqlite --name check_noop
  • nix develop --command just lint
  • nix develop --command just test
  • nix develop --command just build

Closes #307

## Problem Fresh databases still replayed the full historical migration chain, creating removed surfaces before later drop migrations cleaned them up. That made the blank-start schema harder to reason about after the #351/#308 retired-auth cleanup landed. ## Solution - Replace the historical migration chain with `0000_blank_start_baseline`, generated from the current single-owner schema. - Keep one forward migration, `0001_deployed_schema_cleanup`, with a timestamp after the previous chain so already-deployed databases can drop retired tables and rebuild `users` without losing task/calendar/provider data. - Remove the now-unused `invite_links` schema export from the active schema. - Expand schema migration tests to cover the fresh compact baseline, retired surface absence, Drizzle schema drift, and the deployed-database cleanup path. This PR is based on current `main` after #351/#308, not the old stacked branch. ## Verification - `nix develop --command pnpm exec vitest run tests/core/schema.test.ts tests/core/auth.test.ts tests/api/auth.test.ts tests/core/integration-config.test.ts tests/core/external-links.test.ts --reporter=verbose` - `nix develop --command pnpm exec drizzle-kit generate --schema ./src/db/schema.ts --out ./drizzle --dialect sqlite --name check_noop` - `nix develop --command just lint` - `nix develop --command just test` - `nix develop --command just build` Closes #307
cleanup: compact migration baseline
All checks were successful
quality / Test (pull_request) Successful in 18s
quality / Lint (pull_request) Successful in 21s
quality / Build (pull_request) Successful in 42s
e4404de750
barrettruth deleted branch issue-307-compact-blank-baseline 2026-05-11 20:50:48 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/delta!354
No description provided.