Browse Source

fix: escape single quote properly and update default value by overriding the col object

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/7173/head
Pranav C 11 months ago committed by Ramesh Mane
parent
commit
56a33bd862
  1. 7
      packages/nocodb/src/services/columns.service.ts

7
packages/nocodb/src/services/columns.service.ts

@ -444,12 +444,7 @@ export class ColumnsService {
} }
// handle single quote for default value // handle single quote for default value
if ( if (driverType === 'pg' || driverType === 'sqlite3') {
driverType === 'mysql' ||
driverType === 'mysql2' ||
driverType === 'pg' ||
driverType === 'sqlite3'
) {
colBody.cdf = colBody.cdf.replace(/'/g, "'"); colBody.cdf = colBody.cdf.replace(/'/g, "'");
} else { } else {
colBody.cdf = colBody.cdf.replace(/'/g, "''"); colBody.cdf = colBody.cdf.replace(/'/g, "''");

Loading…
Cancel
Save