1
0
Fork 0
mirror of synced 2024-09-10 14:35:47 +12:00
This commit is contained in:
Adria Navarro 2023-10-06 10:57:43 +02:00
parent 1b7be0d637
commit 74cba9de27

View file

@ -7,7 +7,12 @@ import { employeeImport } from "./employeeImport"
import { jobsImport } from "./jobsImport" import { jobsImport } from "./jobsImport"
import { expensesImport } from "./expensesImport" import { expensesImport } from "./expensesImport"
import { db as dbCore } from "@budibase/backend-core" import { db as dbCore } from "@budibase/backend-core"
import { Table, Row, RelationshipType } from "@budibase/types" import {
Table,
Row,
RelationshipType,
AutoColumnFieldMetadata,
} from "@budibase/types"
export const DEFAULT_JOBS_TABLE_ID = "ta_bb_jobs" export const DEFAULT_JOBS_TABLE_ID = "ta_bb_jobs"
export const DEFAULT_INVENTORY_TABLE_ID = "ta_bb_inventory" export const DEFAULT_INVENTORY_TABLE_ID = "ta_bb_inventory"
@ -27,9 +32,9 @@ export const DEFAULT_BB_DATASOURCE = defaultDatasource
function syncLastIds(table: Table, rowCount: number) { function syncLastIds(table: Table, rowCount: number) {
Object.keys(table.schema).forEach(key => { Object.keys(table.schema).forEach(key => {
const entry = table.schema[key] const entry = table.schema[key] as AutoColumnFieldMetadata
if (entry.autocolumn && entry.subtype == "autoID") { if (entry.autocolumn && entry.subtype == "autoID") {
;(entry as any).lastID = rowCount entry.lastID = rowCount
} }
}) })
} }