diff --git a/packages/nc-gui/composables/useColumnCreateStore.ts b/packages/nc-gui/composables/useColumnCreateStore.ts index 98ff4bbd14..23d5c88c33 100644 --- a/packages/nc-gui/composables/useColumnCreateStore.ts +++ b/packages/nc-gui/composables/useColumnCreateStore.ts @@ -31,7 +31,7 @@ interface ValidationsObj { const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState( (meta: Ref, column: Ref) => { const projectStore = useProject() - const { isMysql: isMysqlFunc, isPg: isPgFunc, isMssql: isMssqlFunc, isXcdbBase: isXcdbBaseFunc } = projectStore + const { isMysql: isMysqlFunc, isPg: isPgFunc, isMssql: isMssqlFunc, isXcdbBase: isXcdbBaseFunc, getBaseType } = projectStore const { project, sqlUis } = storeToRefs(projectStore) const { $api } = useNuxtApp() @@ -54,6 +54,8 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState const isXcdbBase = computed(() => isXcdbBaseFunc(meta.value?.base_id ? meta.value?.base_id : Object.keys(sqlUis.value)[0])) + const baseType = computed(() => getBaseType(meta.value?.base_id ? meta.value?.base_id : Object.keys(sqlUis.value)[0])) + const idType = null const additionalValidations = ref({}) @@ -101,7 +103,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState }) }, }, - fieldLengthValidator(project.value?.bases?.[0].type || ClientType.MYSQL), + fieldLengthValidator(baseType.value || ClientType.MYSQL), ], uidt: [ { diff --git a/packages/nc-gui/store/project.ts b/packages/nc-gui/store/project.ts index 2771d428cb..cc512a5214 100644 --- a/packages/nc-gui/store/project.ts +++ b/packages/nc-gui/store/project.ts @@ -227,5 +227,6 @@ export const useProject = defineStore('projectStore', () => { isXcdbBase, hasEmptyOrNullFilters, setProject, + getBaseType, } })