fix: localizeStatus PG migration db.execute signature#16889
Open
JarrodMFlesch wants to merge 1 commit into
Open
fix: localizeStatus PG migration db.execute signature#16889JarrodMFlesch wants to merge 1 commit into
JarrodMFlesch wants to merge 1 commit into
Conversation
All db.execute calls used the wrong signature:
db.execute({ drizzle: db.drizzle, sql: sql`...` })
The db parameter in MigrateUpArgs IS the raw Drizzle PostgresDB instance.
It has no .drizzle sub-property. The correct call is:
db.execute(sql`...`)
Also fixes inserted.length -> inserted.rows.length in up.ts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
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.
What
Fixes the broken
localizeStatusmigration for PostgreSQL databases.Why
All
db.executecalls in the 4 SQL migration files used the wrong signature:The
dbparameter passed into migration functions IS the raw DrizzlePostgresDBinstance — it has no.drizzlesub-property. The correct call pattern (used throughout the rest of the drizzle codebase) is:Also fixes
inserted.length→inserted.rows.lengthinup.ts(the result object has a.rowsarray, not a top-level length).Files changed
sql/up.tssql/down.tssql/migrateMainCollection.tssql/migrateMainGlobal.tsThese are pure bug fixes with no behaviour changes — the migration logic is identical, only the call signature is corrected.
Created from comments on this PR #14667