Socket
Socket
Sign inDemoInstall

cormo

Package Overview
Dependencies
Maintainers
4
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cormo - npm Package Compare versions

Comparing version 0.14.3 to 0.14.4

12

lib/adapters/sqlite3.js

@@ -94,7 +94,10 @@ "use strict";

const all_indexes = {};
const all_foreign_keys = {};
for (const table of tables) {
table_schemas[table] = await this._getSchema(table);
all_indexes[table] = await this._getIndexes(table);
all_foreign_keys[table] = await this._getForeignKeys(table);
}
return {
foreign_keys: all_foreign_keys,
indexes: all_indexes,

@@ -564,2 +567,11 @@ tables: table_schemas,

/** @internal */
async _getForeignKeys(table) {
const rows = await this._client.allAsync(`PRAGMA foreign_key_list(\`${table}\`)`);
const foreign_keys = {};
for (const row of rows) {
foreign_keys[row.from] = row.table;
}
return foreign_keys;
}
/** @internal */
_buildUpdateSetOfColumn(property, data, values, fields, places, insert = false) {

@@ -566,0 +578,0 @@ const dbname = property._dbname_us;

5

lib/connection/index.js

@@ -265,3 +265,4 @@ "use strict";

for (const index in (_c = current.indexes) === null || _c === void 0 ? void 0 : _c[modelClass.table_name]) {
if (!lodash_1.default.find(modelClass._indexes, (item) => item.options.name === index)) {
// MySQL add index for foreign key, so does not need to remove if the index is defined in integrities
if (!lodash_1.default.find(modelClass._indexes, (item) => item.options.name === index) && !lodash_1.default.find(modelClass._integrities, (item) => item.column === index)) {
changes.push({ message: `Remove index on ${modelClass.table_name} ${index}`, ignorable: true });

@@ -287,3 +288,3 @@ }

&& current.foreign_keys[modelClass.table_name][integrity.column];
if (!(current_foreign_key && current_foreign_key === integrity.parent.table_name)) {
if (!(current_foreign_key && current_foreign_key === integrity.parent.table_name) && this._adapter.native_integrity) {
const table_name = modelClass.table_name;

@@ -290,0 +291,0 @@ const parent_table_name = integrity.parent.table_name;

4

package.json
{
"name": "cormo",
"description": "ORM framework for Node.js",
"version": "0.14.3",
"version": "0.14.4",
"keywords": [

@@ -71,3 +71,3 @@ "orm",

},
"gitHead": "3c16d92a0676d0a07d22ee25f26499b6c9249ca3"
"gitHead": "72ff458d110180903c7358cccd8f9388e175f505"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc