Skip to content

Mdmapp migration#9

Merged
aersam merged 2 commits into
mainfrom
mdmapp-migration
Jul 17, 2026
Merged

Mdmapp migration#9
aersam merged 2 commits into
mainfrom
mdmapp-migration

Conversation

@aersam

@aersam aersam commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

No description provided.

aersam and others added 2 commits July 17, 2026 09:35
database/migrations/*.sql files are for one-time manual application
against real (already-provisioned) databases, not for building a fresh
schema -- that was never their intended purpose. Replaying them against
apply_schema()'s freshly-built base schema is the wrong mechanism: it
requires classifying which migration statements are "safe" to re-run
purely from source text, which is unreliable in practice (e.g. a
legitimate add-column-then-drop-old-column retirement migration has no
sound way to distinguish itself from a genuinely destructive one using a
substring heuristic alone).

The correct fix for a project whose migrations/ dir has drifted ahead of
its base table files is to update the base files directly so they reflect
the current, final schema on their own -- apply_schema()'s existing
behavior (apply every non-migrations .sql file in dependency order) is
then sufficient with no special-casing needed.

Bump to 0.2.1 since this reverts published migration-replay behavior from
the just-released 0.2.0.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ad1oGCCUheJVhcmwxHWsdU
Call out the "why" directly where an agent would look (right after
ensure_testdb()'s description in SKILL.md), since this was tried and
reverted once already -- docs/database-layout.md already documented the
rule ("Skipped by pgdb testdb") but that alone didn't stop it from being
violated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ad1oGCCUheJVhcmwxHWsdU
@aersam
aersam merged commit 426abd9 into main Jul 17, 2026
1 check passed
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