Renamings

This commit is contained in:
Adria Navarro 2024-07-26 14:29:20 +02:00
parent d7e2f0fc0e
commit 4cf3706904
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ export async function save(
// check for case sensitivity - we don't want to allow duplicated columns
const duplicateColumn = findDuplicateInternalColumns(table, {
internalRowsAllowed: !!opts?.isImport,
ignoreProtectedColumnNames: !oldTable && !!opts?.isImport,
})
if (duplicateColumn.length) {
throw new Error(

View File

@ -55,7 +55,7 @@ export function canBeSortColumn(type: FieldType): boolean {
export function findDuplicateInternalColumns(
table: Table,
opts?: { internalRowsAllowed: boolean }
opts?: { ignoreProtectedColumnNames: boolean }
): string[] {
// maintains the case of keys
const casedKeys = Object.keys(table.schema)
@ -72,7 +72,7 @@ export function findDuplicateInternalColumns(
}
}
}
if (!opts?.internalRowsAllowed) {
if (!opts?.ignoreProtectedColumnNames) {
for (let internalColumn of CONSTANT_INTERNAL_ROW_COLS) {
if (casedKeys.find(key => key === internalColumn)) {
duplicates.push(internalColumn)