Remove logic from frontend
This commit is contained in:
parent
569488deee
commit
95a9641c08
|
@ -7,11 +7,6 @@
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { getContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
import { ValidColumnNameRegex } from "@budibase/shared-core"
|
import { ValidColumnNameRegex } from "@budibase/shared-core"
|
||||||
import {
|
|
||||||
BBReferenceFieldSubType,
|
|
||||||
FieldType,
|
|
||||||
RelationshipType,
|
|
||||||
} from "@budibase/types"
|
|
||||||
|
|
||||||
const { API, definition, rows } = getContext("grid")
|
const { API, definition, rows } = getContext("grid")
|
||||||
|
|
||||||
|
@ -33,20 +28,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const migrateUserColumn = async () => {
|
const migrateUserColumn = async () => {
|
||||||
const type =
|
|
||||||
column.schema.relationshipType === RelationshipType.ONE_TO_MANY
|
|
||||||
? FieldType.BB_REFERENCE_SINGLE
|
|
||||||
: FieldType.BB_REFERENCE
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await API.migrateColumn({
|
await API.migrateColumn({
|
||||||
tableId: $definition._id,
|
tableId: $definition._id,
|
||||||
oldColumn: column.schema,
|
oldColumn: column.schema.name,
|
||||||
newColumn: {
|
newColumn: newColumnName,
|
||||||
name: newColumnName,
|
|
||||||
type,
|
|
||||||
subtype: BBReferenceFieldSubType.USER,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
notifications.success("Column migrated")
|
notifications.success("Column migrated")
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue