From 9e64e82c7e3936f3dae5b2c7a2cc9244de0f069e Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 15 Jun 2022 10:36:50 +0530 Subject: [PATCH] fix: decimal to double converstion, ignore for pg Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../nocodb/src/lib/meta/api/sync/helpers/job.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/nocodb/src/lib/meta/api/sync/helpers/job.ts b/packages/nocodb/src/lib/meta/api/sync/helpers/job.ts index 4d8743cf36..e9a165efec 100644 --- a/packages/nocodb/src/lib/meta/api/sync/helpers/job.ts +++ b/packages/nocodb/src/lib/meta/api/sync/helpers/job.ts @@ -167,6 +167,10 @@ export default async ( return ft.view; } + function getRootDbType() { + return ncCreatedProjectSchema?.bases[0]?.type; + } + // base mapping table const aTblNcTypeMap = { foreignKey: UITypes.LinkToAnotherRecord, @@ -488,10 +492,14 @@ export default async ( // change from default 'tinytext' as airtable allows more than 255 characters // for single line text column type if (col.type === 'text') ncCol.dt = 'text'; - if (ncCol.uidt === UITypes.Decimal) { - ncCol.dt = 'double'; - ncCol.dtxp = 22; - ncCol.dtxs = '2'; + + // #fix-2363-decimal-out-of-range + if (['sqlite3', 'mysql2'].includes(getRootDbType())) { + if (ncCol.uidt === UITypes.Decimal) { + ncCol.dt = 'double'; + ncCol.dtxp = 22; + ncCol.dtxs = '2'; + } } // additional column parameters when applicable