mirror of
https://github.com/frappe/books.git
synced 2024-12-22 10:58:59 +00:00
fix: #808 Payment referenceType NULL due to bad migration
This commit is contained in:
parent
c7c7aae1f4
commit
27d67a33e5
@ -4,6 +4,7 @@ import createInventoryNumberSeries from './createInventoryNumberSeries';
|
||||
import fixRoundOffAccount from './fixRoundOffAccount';
|
||||
import testPatch from './testPatch';
|
||||
import updateSchemas from './updateSchemas';
|
||||
import setPaymentReferenceType from './setPaymentReferenceType';
|
||||
|
||||
export default [
|
||||
{ name: 'testPatch', version: '0.5.0-beta.0', patch: testPatch },
|
||||
@ -28,4 +29,9 @@ export default [
|
||||
version: '0.6.6-beta.0',
|
||||
patch: createInventoryNumberSeries,
|
||||
},
|
||||
{
|
||||
name: 'setPaymentReferenceType',
|
||||
version: '0.21.0',
|
||||
patch: setPaymentReferenceType,
|
||||
},
|
||||
] as Patch[];
|
||||
|
9
backend/patches/setPaymentReferenceType.ts
Normal file
9
backend/patches/setPaymentReferenceType.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { DatabaseManager } from '../database/manager';
|
||||
|
||||
async function execute(dm: DatabaseManager) {
|
||||
await dm.db!.knex!('Payment')
|
||||
.where({ referenceType: null })
|
||||
.update({ referenceType: 'SalesInvoice' });
|
||||
}
|
||||
|
||||
export default { execute, beforeMigrate: true };
|
Loading…
Reference in New Issue
Block a user