Skip to content

Conversation

@busbyk
Copy link
Collaborator

@busbyk busbyk commented Oct 23, 2025

Description

Upgrades to payload version 3.61.0.

Key Changes

  • Upgrades payload version to 3.61.0
  • Aligns pino and pino-pretty versions with versions used by Payload
  • Updates types of payload.logger params and usage of logger.error
  • Includes a custom migration (see explanation)

Migration explanation

Initially, Payload/Drizzle generated a huge migration with the create, drop, rename pattern that causes data loss in libSQL/Turso. So I wrote a simplified migration that just recreates indexes.

3.61.0 includes a change to how foreign keys and indexes are named. Full explanation in src/migrations/20251023_195638_rename_indexes_explanation.md

SQLite apparently doesn't have named foreign keys so we don't need to change those, but we do need to maintain the generated snapshot JSON file so that pnpm payload migrate:create doesn't try to create the massive migration again in the future.

I would love a careful review of my logic here by the team.

I ran this migration locally without issue.

…s to match versions used by payload + updating format of logger.error usages
@github-actions
Copy link

Preview deployment: https://upgrade-payload.preview.avy-fx.org

@github-actions
Copy link

Migration Safety Check

Found 3 potential issues:

20251023_195638_rename_indexes.ts

Warning (line 16): DROP keyword detected - review for data loss

// Drop old indexes with _idx suffix

Warning (line 17): DROP keyword detected - review for data loss

await db.run(sql`DROP INDEX IF EXISTS \`roles_texts_order_parent_idx\`;`)

Warning (line 18): DROP keyword detected - review for data loss

await db.run(sql`DROP INDEX IF EXISTS \`global_roles_texts_order_parent_idx\`;`)

Review these patterns and add backup/restore logic if needed. See docs/migration-safety.md for guidance.

@stevekuznetsov stevekuznetsov added this pull request to the merge queue Oct 23, 2025
Merged via the queue into main with commit b397cd2 Oct 23, 2025
7 of 8 checks passed
@stevekuznetsov stevekuznetsov deleted the upgrade-payload branch October 23, 2025 22:21
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.

3 participants