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/7197/head
Pranav C 12 months ago
parent
commit
e3fb0ca87d
  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