mirror of
https://github.com/frappe/books.git
synced 2024-11-10 15:50:56 +00:00
23 lines
549 B
TypeScript
23 lines
549 B
TypeScript
|
import { getDefaultMetaFieldValueMap } from '../../backend/helpers';
|
||
|
import { DatabaseManager } from '../database/manager';
|
||
|
|
||
|
async function execute(dm: DatabaseManager) {
|
||
|
const schemaName = 'NumberSeries';
|
||
|
const name = 'SMOV-';
|
||
|
const exists = await dm.db?.exists(schemaName, name);
|
||
|
if (exists) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
await dm.db?.insert(schemaName, {
|
||
|
name,
|
||
|
start: 1001,
|
||
|
padZeros: 4,
|
||
|
current: 0,
|
||
|
referenceType: 'StockMovement',
|
||
|
...getDefaultMetaFieldValueMap(),
|
||
|
});
|
||
|
}
|
||
|
|
||
|
export default { execute, beforeMigrate: true };
|