Skip to content

refactor(db): flatten migrations into a 2.0.0 baseline - #193

Merged
MrAlders0n merged 1 commit into
devfrom
chore/flatten-migrations
Oct 1, 2026
Merged

MrAlders0n merged 1 commit into
devfrom
chore/flatten-migrations

Conversation

@MrAlders0n

Copy link
Copy Markdown
Member

Replaces the 1.x migration chain (001–045) with a single 001_baseline.sql for 2.0.0.

  • Baseline is a schema-only dump of a fresh database migrated through 045, with materialized views created WITH DATA (so REFRESH ... CONCURRENTLY works) and view bodies taken from their original migrations so sqlc generate output is unchanged.
  • Startup now refuses a pre-2.0.0 database (1.x ledger, or tables with no ledger) instead of applying the baseline on top. 2.0.0 needs a fresh database.
  • Integration tests build their schema from the baseline; tests for one-time 1.x upgrades are removed. New tests cover baseline apply, idempotent rerun and the refusal.

2.0.0 is a fresh deploy, so the 1.x chain becomes one schema file. Startup now refuses a pre-2.0.0 database instead of applying the baseline on top.
@MrAlders0n
MrAlders0n merged commit 3ac4035 into dev Oct 1, 2026
3 checks passed
@MrAlders0n
MrAlders0n deleted the chore/flatten-migrations branch October 1, 2026 01:37
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