Fix more types
This commit is contained in:
parent
21e2d7ddbe
commit
40226c5c3a
|
@ -4,6 +4,8 @@ import { context } from "@budibase/backend-core"
|
|||
import {
|
||||
Ctx,
|
||||
FieldType,
|
||||
ManyToOneRelationshipFieldMetadata,
|
||||
OneToManyRelationshipFieldMetadata,
|
||||
Row,
|
||||
SearchFilters,
|
||||
Table,
|
||||
|
@ -19,7 +21,14 @@ function isForeignKey(key: string, table: Table) {
|
|||
const relationships = Object.values(table.schema).filter(
|
||||
column => column.type === FieldType.LINK
|
||||
)
|
||||
return relationships.some(relationship => relationship.foreignKey === key)
|
||||
return relationships.some(
|
||||
relationship =>
|
||||
(
|
||||
relationship as
|
||||
| OneToManyRelationshipFieldMetadata
|
||||
| ManyToOneRelationshipFieldMetadata
|
||||
).foreignKey === key
|
||||
)
|
||||
}
|
||||
|
||||
validateJs.extend(validateJs.validators.datetime, {
|
||||
|
|
|
@ -584,7 +584,7 @@ class TestConfiguration {
|
|||
tableConfig.schema[link] = {
|
||||
type: FieldType.LINK,
|
||||
fieldName: link,
|
||||
tableId: this.table._id,
|
||||
tableId: this.table._id!,
|
||||
name: link,
|
||||
relationshipType,
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ interface NumberForeignKeyMetadata {
|
|||
|
||||
export type NumberFieldMetadata = BaseFieldSchema & {
|
||||
type: FieldType.NUMBER
|
||||
autocolumn: boolean
|
||||
autocolumn?: boolean
|
||||
} & (NumberForeignKeyMetadata | {})
|
||||
|
||||
export interface DateFieldMetadata extends BaseFieldSchema {
|
||||
|
|
Loading…
Reference in New Issue