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 11 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
if (
driverType === 'mysql' ||
driverType === 'mysql2' ||
driverType === 'pg' ||
driverType === 'sqlite3'
) {
if (driverType === 'pg' || driverType === 'sqlite3') {
colBody.cdf = colBody.cdf.replace(/'/g, "'");
} else {
colBody.cdf = colBody.cdf.replace(/'/g, "''");

Loading…
Cancel
Save