Skip to content

Fix bad migration json#959

Merged
rchlfryn merged 1 commit intomainfrom
add-missing-migration
Feb 27, 2026
Merged

Fix bad migration json#959
rchlfryn merged 1 commit intomainfrom
add-missing-migration

Conversation

@rchlfryn
Copy link
Collaborator

Description

Fixes the migration JSON snapshot in 20260131_012456_remove_wrap_in_container.json which still referenced the old button_appearance column name instead of button_variant. This caused Payload to repeatedly suggest creating a migration to rename appearance to variant — a migration that already exists.

Related Issues

Caused by #899 (Improve and simplify wrapInContainer behavior with background color picker). That PR's migration snapshot was generated from a schema state that predated the button_appearancebutton_variant rename from #892 (Clean up how we use links). Since the remove_wrap_in_container migration is the last in the list, its stale snapshot became the baseline Payload compares against, causing a perpetual diff.

Key Changes

  • Updated 20260131_012456_remove_wrap_in_container.json to replace 8 occurrences of button_appearance with button_variant, matching the actual database state after migration 20260128_213937_rename_appearance_to_variant runs

How to test

  1. Run pnpm payload migrate:create — it should report no schema changes needed (previously it would generate a rename migration every time)

Migration Explanation

No new migration. This corrects the JSON snapshot of an existing migration so Payload's schema diffing works correctly.

Future enhancements / Questions

When creating migrations on branches, we should ensure the latest snapshot reflects all prior migrations in the chain. This can happen when two PRs with migrations are developed in parallel — whichever merges second may have a snapshot that doesn't include the first PR's changes.

@rchlfryn rchlfryn added this pull request to the merge queue Feb 27, 2026
@rchlfryn rchlfryn removed this pull request from the merge queue due to a manual request Feb 27, 2026
@github-actions
Copy link
Contributor

Preview deployment: https://add-missing-migration.preview.avy-fx.org

@rchlfryn rchlfryn added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit cc499cc Feb 27, 2026
9 of 10 checks passed
@rchlfryn rchlfryn deleted the add-missing-migration branch February 27, 2026 22:24
@github-actions
Copy link
Contributor

🚀 This is included in version v1.9.1

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