Skip to content

📝 docs: a failed migration runs again from the top; drop the unstable badge - #88

Merged
gfazioli merged 3 commits into
mainfrom
docs/migration-retry-and-badges
Oct 7, 2026
Merged

gfazioli merged 3 commits into
mainfrom
docs/migration-retry-and-badges

Conversation

@gfazioli

@gfazioli gfazioli commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Two small changes.

Migrations (content/database-orm/migrations.mdx, When a migration fails): one paragraph saying that a retry runs the failed migration again from its first statement while what it changed before failing stays (WordPress queries autocommit, and MySQL cannot roll back CREATE/ALTER/DROP), so a migration has to survive running twice: create() already does, rows go behind isEmpty(), a hand-written statement checks first. Settled against the code: Migrator::migrate() records a file only after it ran without an exception or a new database error (src/Database/Migrations/Migrator.php 200–237 at v3.0.0), and nothing in src/ opens a transaction.

Badges (components/Poser/Poser.tsx, used on the introduction and the eight package pages):

  • the Packagist unstable badge is gone (it showed dev-master / dev-dev next to the stable version);
  • the CHANGELOG badge linked blob/main/CHANGELOG.md, a 404 on all nine pages (the framework's branch is master; the packages have no CHANGELOG.md). It now opens the repository's GitHub Releases, which all nine have.

yarn test: 10 suites, 65 tests, format, lint and typecheck green.

…leases

The CHANGELOG badge linked blob/main/CHANGELOG.md: a 404 for the framework,
whose branch is master, and for the eight packages, which have no CHANGELOG.md.
Every one of them has GitHub Releases.
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
wpbones-website-docs Ready Ready Preview Oct 7, 2026 11:41am UTC

Request Review

@gfazioli
gfazioli requested a balanced review from Copilot October 7, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…retry

From an independent review of #88: the DROP COLUMN example failed on a second
run (MySQL has no DROP COLUMN IF EXISTS), dbDelta() applies what differs rather
than only adding, isEmpty() is for rows that must not go in twice (a refresh
truncates instead), and Seeding's list of re-runs lacked the retry.
The guarded DROP was run twice on wpbones.test: dropped, then skipped, no error.
@gfazioli

gfazioli commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Copilot could not review (quota). An independent review checked every claim of the new paragraph against Migrator.php, Migration.php, wpdb, dbDelta() and the SQLite integration: retry from the top, nothing recorded on failure, autocommit, create() safe to re-run, links. It found three things, fixed in b8ad6d6: the DROP COLUMN example under Changing a table failed on a second run (now guarded, run twice on a local install: dropped, then skipped, no error), "only adds what is missing" is now "applies only what differs", and isEmpty() is scoped to rows that must not go in twice, with the retry added to Seeding's list of re-runs.

@gfazioli
gfazioli merged commit b8ad6d6 into main Oct 7, 2026
2 checks passed
@gfazioli
gfazioli deleted the docs/migration-retry-and-badges branch October 7, 2026 11:42

This branch was successfully deployed

2 active deployments
Production — b8ad6d69 Deployed Oct 7, 2026 by vercel[bot]
Preview — b8ad6d69 Deployed Oct 7, 2026 by vercel[bot]
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.

2 participants