@rudsys/n8n-nodes-sqlite3 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -396,7 +396,11 @@ class SqliteSsh {
|
|
|
396
396
|
// For rename: table param is OLD name, newTableName is NEW name
|
|
397
397
|
// For drop: table param is table to drop
|
|
398
398
|
if (action === 'create') {
|
|
399
|
-
|
|
399
|
+
let columnsDef = this.getNodeParameter('tableColumnsDefinition', i);
|
|
400
|
+
columnsDef = columnsDef.trim();
|
|
401
|
+
if (columnsDef.startsWith('(') && columnsDef.endsWith(')')) {
|
|
402
|
+
columnsDef = columnsDef.slice(1, -1);
|
|
403
|
+
}
|
|
400
404
|
sql = `CREATE TABLE ${table} (${columnsDef});`;
|
|
401
405
|
}
|
|
402
406
|
else if (action === 'rename') {
|
|
@@ -417,7 +421,11 @@ class SqliteSsh {
|
|
|
417
421
|
else {
|
|
418
422
|
const colName = escapeIdentifier(this.getNodeParameter('columnName', i));
|
|
419
423
|
if (action === 'add') {
|
|
420
|
-
|
|
424
|
+
let colDef = this.getNodeParameter('columnDefinition', i);
|
|
425
|
+
colDef = colDef.trim();
|
|
426
|
+
if (colDef.startsWith('(') && colDef.endsWith(')')) {
|
|
427
|
+
colDef = colDef.slice(1, -1);
|
|
428
|
+
}
|
|
421
429
|
sql = `ALTER TABLE ${table} ADD COLUMN ${colName} ${colDef};`;
|
|
422
430
|
}
|
|
423
431
|
else if (action === 'rename') {
|