Mdmapp migration#9
Merged
Merged
Conversation
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
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.
No description provided.