This commit is contained in:
Adria Navarro 2023-09-14 15:18:54 +02:00
parent eb748db3be
commit 85a9b9ab21
2 changed files with 3 additions and 5 deletions

View File

@ -66,7 +66,7 @@
let jsonSchemaModal let jsonSchemaModal
let allowedTypes = [] let allowedTypes = []
let editableColumn = { let editableColumn = {
type: "string", type: fieldDefinitions.STRING.type,
constraints: fieldDefinitions.STRING.constraints, constraints: fieldDefinitions.STRING.constraints,
// Initial value for column name in other table for linked records // Initial value for column name in other table for linked records
fieldName: $tables.selected.name, fieldName: $tables.selected.name,

View File

@ -422,13 +422,11 @@ export function hasTypeChanged(table: Table, oldTable: Table | undefined) {
if (!oldTable) { if (!oldTable) {
return false return false
} }
let key: any for (let [key, field] of Object.entries(oldTable.schema)) {
let field: any
for ([key, field] of Object.entries(oldTable.schema)) {
const oldType = field.type
if (!table.schema[key]) { if (!table.schema[key]) {
continue continue
} }
const oldType = field.type
const newType = table.schema[key].type const newType = table.schema[key].type
if (oldType !== newType && !areSwitchableTypes(oldType, newType)) { if (oldType !== newType && !areSwitchableTypes(oldType, newType)) {
return true return true