Merge branch 'master' into table-width-setting
This commit is contained in:
commit
87a575f1d0
|
@ -1,3 +1,4 @@
|
||||||
|
process.env.DISABLE_PINO_LOGGER = "1"
|
||||||
process.env.NO_JS = "1"
|
process.env.NO_JS = "1"
|
||||||
process.env.JS_BCRYPT = "1"
|
process.env.JS_BCRYPT = "1"
|
||||||
process.env.DISABLE_JWT_WARNING = "1"
|
process.env.DISABLE_JWT_WARNING = "1"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
process.env.DISABLE_PINO_LOGGER = "1"
|
// have to import this before anything else
|
||||||
import "./environment"
|
import "./environment"
|
||||||
import { getCommands } from "./options"
|
import { getCommands } from "./options"
|
||||||
import { Command } from "commander"
|
import { Command } from "commander"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
dir="$(dirname -- "$(readlink -f "${BASH_SOURCE}")")"
|
dir="$(dirname -- "$(readlink -f "${BASH_SOURCE}")")"
|
||||||
${dir}/node_modules/ts-node/dist/bin.js ${dir}/src/index.ts $@
|
${dir}/../../node_modules/ts-node/dist/bin.js ${dir}/src/index.ts $@
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { makeExternalQuery } from "../../../integrations/base/query"
|
||||||
import { Format } from "../../../api/controllers/view/exporters"
|
import { Format } from "../../../api/controllers/view/exporters"
|
||||||
import sdk from "../.."
|
import sdk from "../.."
|
||||||
import { isRelationshipColumn } from "../../../db/utils"
|
import { isRelationshipColumn } from "../../../db/utils"
|
||||||
import { SqlClient, isSQL } from "../../../integrations/utils"
|
import { isSQL, SqlClient } from "../../../integrations/utils"
|
||||||
|
|
||||||
const SQL_CLIENT_SOURCE_MAP: Record<SourceName, SqlClient | undefined> = {
|
const SQL_CLIENT_SOURCE_MAP: Record<SourceName, SqlClient | undefined> = {
|
||||||
[SourceName.POSTGRES]: SqlClient.POSTGRES,
|
[SourceName.POSTGRES]: SqlClient.POSTGRES,
|
||||||
|
@ -144,6 +144,10 @@ export async function validate({
|
||||||
throw new Error("Unable to fetch table for validation")
|
throw new Error("Unable to fetch table for validation")
|
||||||
}
|
}
|
||||||
const errors: Record<string, any> = {}
|
const errors: Record<string, any> = {}
|
||||||
|
const disallowArrayTypes = [
|
||||||
|
FieldType.ATTACHMENT_SINGLE,
|
||||||
|
FieldType.BB_REFERENCE_SINGLE,
|
||||||
|
]
|
||||||
for (let fieldName of Object.keys(fetchedTable.schema)) {
|
for (let fieldName of Object.keys(fetchedTable.schema)) {
|
||||||
const column = fetchedTable.schema[fieldName]
|
const column = fetchedTable.schema[fieldName]
|
||||||
const constraints = cloneDeep(column.constraints)
|
const constraints = cloneDeep(column.constraints)
|
||||||
|
@ -160,6 +164,10 @@ export async function validate({
|
||||||
if (type === FieldType.OPTIONS && constraints?.inclusion) {
|
if (type === FieldType.OPTIONS && constraints?.inclusion) {
|
||||||
constraints.inclusion.push(null as any, "")
|
constraints.inclusion.push(null as any, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (disallowArrayTypes.includes(type) && Array.isArray(row[fieldName])) {
|
||||||
|
errors[fieldName] = `Cannot accept arrays`
|
||||||
|
}
|
||||||
let res
|
let res
|
||||||
|
|
||||||
// Validate.js doesn't seem to handle array
|
// Validate.js doesn't seem to handle array
|
||||||
|
|
Loading…
Reference in New Issue