fix: sql collection creation issue (#3087)

This commit is contained in:
YANG QIA 2023-11-24 15:43:04 +08:00 committed by GitHub
parent 2630f25e51
commit 039deac92b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,9 +9,7 @@ import { useCompile } from '../../../../schema-component';
import { useCollectionManager } from '../../../hooks'; import { useCollectionManager } from '../../../hooks';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { FieldOptions } from '@nocobase/database'; import { FieldOptions } from '@nocobase/database';
import { ResourceActionContext, useResourceContext } from '../../../ResourceActionProvider'; import { ResourceActionContext } from '../../../ResourceActionProvider';
import { useRecord } from '../../../../record-provider';
import { last } from 'lodash';
const inferInterface = (field: string, value: any) => { const inferInterface = (field: string, value: any) => {
if (field.toLowerCase().includes('id')) { if (field.toLowerCase().includes('id')) {
@ -24,7 +22,7 @@ const inferInterface = (field: string, value: any) => {
return 'number'; return 'number';
} }
if (typeof value === 'boolean') { if (typeof value === 'boolean') {
return 'boolean'; return 'checkbox';
} }
if (dayjs(value).isValid()) { if (dayjs(value).isValid()) {
return 'datetime'; return 'datetime';