1
0
Fork 0
mirror of synced 2024-06-02 18:44:54 +12:00
budibase/qa-core/src/config/internal-api/fixtures/table.ts
2022-10-25 09:02:55 +01:00

35 lines
705 B
TypeScript

import { Table } from "@budibase/types"
export const generateTable = (): Table => {
return {
name: "Test Table",
schema: {},
sourceId: "bb_internal",
type: "internal",
dataImport: {
valid: true,
schema: {},
},
}
}
export const generateNewColumnForTable = (tableData: any): Table => {
const newColumn = tableData
newColumn.schema = {
TestColumn: {
type: "string",
name: "TestColumn",
constraints: {
presence: { allowEmpty: false },
length: { maximum: null },
type: "string",
},
},
}
newColumn.indexes = {
0: "TestColumn",
}
newColumn.updatedAt = new Date().toISOString()
return newColumn
}