Browse Source

Merge pull request #7445 from nocodb/nc-fix/cdf-serial

fix: serialize default value
pull/7449/head
Mert E 10 months ago committed by GitHub
parent
commit
6e0b4274f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts

7
packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts

@ -158,12 +158,13 @@ export class ExportService {
// pg default value fix // pg default value fix
if (source.type === 'pg') { if (source.type === 'pg') {
if (column.cdf) { if (column.cdf) {
const cdf = column.cdf.toString();
// check if column.cdf has unmatched single quotes // check if column.cdf has unmatched single quotes
const matches = column.cdf.match(/'/g); const matches = cdf.match(/'/g);
if (matches && matches.length % 2 !== 0) { if (matches && matches.length % 2 !== 0) {
// if so remove after last single quote // if so remove after last single quote
const lastQuoteIndex = column.cdf.lastIndexOf("'"); const lastQuoteIndex = cdf.lastIndexOf("'");
column.cdf = column.cdf.substring(0, lastQuoteIndex); column.cdf = cdf.substring(0, lastQuoteIndex);
} }
} }
} }

Loading…
Cancel
Save