diff --git a/README.md b/README.md index 98a7776..bd0900d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -![Publish Github Package](https://github.com/letsfullstack/loopback-connector-postgresql/workflows/Publish%20Github%20Package/badge.svg) + ![Publish Github Package](https://github.com/letsfullstack/loopback-connector-postgresql/workflows/Publish%20Github%20Package/badge.svg) + +# Loopback PostgreSQL Connector no projeto ArboBackend + +Faça o NPM install desse projeto e copie a pasta para node_modules/@letscomunica/loopback-connector-postgresql ( substitua a página caso exita ) # Loopback PostgreSQL Connector diff --git a/lib/migration.js b/lib/migration.js index eeaf52c..4636d91 100644 --- a/lib/migration.js +++ b/lib/migration.js @@ -224,9 +224,9 @@ function mixinMigration(PostgreSQL) { if (self.idColumn(model) === actualField.column) { return; } - if (actualFieldNotPresentInModel(actualField, model)) { - sql.push('DROP COLUMN ' + self.escapeName(actualField.column)); - } + // if (actualFieldNotPresentInModel(actualField, model)) { + // sql.push('DROP COLUMN ' + self.escapeName(actualField.column)); + // } }); if (sql.length > 0) { sql = [sql.join(', ')]; @@ -559,7 +559,7 @@ function mixinMigration(PostgreSQL) { propName = propName && self.propertyName(model, propName[1]) || null; if (!(indexNames.indexOf(indexName) > -1) && !(propName && m.properties[propName] && m.properties[propName].index)) { - sql.push('DROP INDEX ' + self.escapeName(indexName)); + // sql.push('DROP INDEX ' + self.escapeName(indexName)); } else { // The index was found, verify that database matches what we're expecting. // first: check single column indexes. @@ -571,7 +571,7 @@ function mixinMigration(PostgreSQL) { !((!si.type || si.type === ai[indexName].type) && (!si.unique || si.unique === ai[indexName].unique)) ) { // Drop the index if the type or unique differs from the actual table - sql.push('DROP INDEX ' + self.escapeName(indexName)); + // sql.push('DROP INDEX ' + self.escapeName(indexName)); delete ai[indexName]; } } @@ -597,7 +597,7 @@ function mixinMigration(PostgreSQL) { } if (!identical) { - sql.push('DROP INDEX ' + self.escapeName(indexName)); + // sql.push('DROP INDEX ' + self.escapeName(indexName)); delete ai[indexName]; } } diff --git a/lib/postgresql.js b/lib/postgresql.js index 0a8a26c..13ace3e 100644 --- a/lib/postgresql.js +++ b/lib/postgresql.js @@ -123,12 +123,6 @@ PostgreSQL.prototype.executeSQL = function(sql, params, options, callback) { debug('SQL: %s', sql); } - if (sql && sql.match('UPDATE') && !sql.match('WHERE') && self.settings.blockUpdateWithoutWhere) { - return process.nextTick(function() { - callback(new Error(g.f('Você está executando um update sem WHERE. Corrija essa query, meu caro:',sql))); - }); - } - function executeWithConnection(connection, done) { connection.query(sql, params, function(err, data) { // if(err) console.error(err); diff --git a/package.json b/package.json index 00a987f..105d831 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "bluebird": "^3.4.6", "debug": "^3.1.0", "loopback-connector": "^4.2.2", - "pg": "^7.0.0", + "pg": "^8.11.3", "strong-globalize": "^3.1.0", "uuid": "^3.0.1" },