-
Notifications
You must be signed in to change notification settings - Fork 10.3k
fix(postgres): fix v15 migration failures on Postgres #51481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(postgres): fix v15 migration failures on Postgres #51481
Conversation
WalkthroughThis change refactors two database-related operations. In repost_accounting_ledger, retrieval of allowed document types was changed from a DISTINCT(document_type) query to pluck-based fetching with application-level deduplication and preservation of order, and results are returned as single-element lists. In the v15 patch, delivery note pick_list propagation was rewritten from ORM-based updates to dialect-specific SQL: an UPDATE...JOIN for MariaDB and UPDATE...FROM for PostgreSQL. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-12-16T05:33:58.723ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b816699 to
626cab7
Compare
# [15.95.0](v15.94.3...v15.95.0) (2026-01-20) ### Bug Fixes * **accounts_controller:** make return message translatable ([8f6095d](8f6095d)) * **accounts:** add missing accounting dimensions in advance taxes and charges ([1d5f406](1d5f406)) * add other charges in total ([3ef4fa5](3ef4fa5)) * allow disassemble stock entry without work order (backport [#51761](#51761)) ([#51835](#51835)) ([be20698](be20698)) * calculate net profit amount from root node accounts ([e9573b0](e9573b0)) * common_party_path ([#51826](#51826)) ([6225217](6225217)) * docs_path ([b3df300](b3df300)) * **manufacturing:** consider process loss qty while validating the work order ([4418fb4](4418fb4)) * **pos:** reapply set warehouse during cart update ([75b4a0a](75b4a0a)) * **postgres:** compute current month sales without DATE_FORMAT ([fbf4305](fbf4305)) * **postgres:** fix v15 migration failures on Postgres ([#51481](#51481)) ([eef26fe](eef26fe)) * prevent UOM from updating incorrectly while scanning barcode ([d196956](d196956)) * **process statement of accounts:** allow renaming ([8b2778b](8b2778b)) * **process statement of accounts:** naming of reports ([054468a](054468a)) * RFQ does not fetch html response ([90e8090](90e8090)) * **sales analytics:** add curve filter ([c2995f6](c2995f6)) * Show non-SLE vouchers with GL entries in Stock vs Account Value Comparison report ([6219d7d](6219d7d)) * **stock entry:** calculate transferred quantity using transfer_qty (backport [#51656](#51656)) ([#51675](#51675)) ([1da781f](1da781f)) * **stock:** resolve quantity issue when adding items via barcode scan ([c508ef5](c508ef5)) * **transaction.js:** use flt instead of cint for plc_conversion_rate ([f618bf2](f618bf2)) * valuation rate for non batchwise valuation ([3008c7a](3008c7a)) ### Features * add new 2025 Charts of Accounts for France ([6af6fe8](6af6fe8)) * **process statement of accounts:** added more frequency options for auto email ([546ab05](546ab05)) * remove old French chart of accounts with code as nex 2025 is provided ([e568ab2](e568ab2)) ### Performance Improvements * prevent duplicate reposting for the same item ([eff9595](eff9595))
|
🎉 This PR is included in version 15.95.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Fix two PostgreSQL-specific failures encountered during
bench --site iliad.local migrateon ERPNext v15.Reproduction
bench --site iliad.local migrateFix 1:
update_pick_list_fieldsfails on Postgres (UPDATE ... JOIN)erpnext.patches.v15_0.update_pick_list_fieldspsycopg2.errors.SyntaxError: syntax error at or near "JOIN"UPDATE <table> JOIN <table>is not supported on Postgresfrappe.db.multisql:UPDATE ... JOINUPDATE ... SET ... FROM ... WHERE ...Fix 2:
allow_on_submit_dimensions_for_repostable_doctypesfails on Postgres (DISTINCT + ordering)erpnext.patches.v15_0.allow_on_submit_dimensions_for_repostable_doctypesget_allowed_types_from_settings(child_doc=True)inerpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.pypsycopg2.errors.InvalidColumnReference: for SELECT DISTINCT, ORDER BY expressions must appear in select listfields=["distinct(document_type)"]generates aSELECT DISTINCT ...query which conflicts with ordering rules on Postgresdistinct(document_type)withpluck="document_type"and de-duplicate results in Python while preserving orderNotes
version-15-hotfixSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.