Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

feathers-knex-modeler

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feathers-knex-modeler - npm Package Compare versions

Comparing version 1.0.12 to 1.3.0

2

package.json
{
"name": "feathers-knex-modeler",
"version": "1.0.12",
"version": "1.3.0",
"description": "This package allows you to easily extend a table while you are developing it without requiring you to drop tables.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -108,2 +108,4 @@ /* eslint-disable no-console */

let hasOnUpdate = _.defaultTo(_.find(allOptions, { type: 'onUpdated' }), false)
self.debug(`Column: ${column.name}, has onDelete defined: ${hasOnDelete}`)
self.debug(`Column: ${column.name}, has onUpdated defined: ${hasOnUpdate}`)
try {

@@ -131,11 +133,15 @@ await db.schema.alterTable(self.name, (table) => {

if (hasOnDelete !== false && hasOnUpdate !== false) {
self.debug(`Column: ${column.name}, references onUpdate and onDelete`)
alterCommand = columnToAlter.references(argument).onDelete(hasOnDelete.argument).onUpdate(hasOnUpdate.argument)
}
if (hasOnDelete !== false && hasOnUpdate === false) {
self.debug(`Column: ${column.name}, references onDelete`)
alterCommand = columnToAlter.references(argument).onDelete(hasOnDelete.argument)
}
if (hasOnUpdate !== false && hasOnDelete === false) {
self.debug(`Column: ${column.name}, references onUpdate`)
alterCommand = columnToAlter.references(argument).onUpdate(hasOnUpdate.argument)
}
if (hasOnDelete === false || hasOnUpdate === false) {
self.debug(`Column: ${column.name}, standard references no onUpdate or onDelete`)
alterCommand = columnToAlter.references(argument)

@@ -146,2 +152,3 @@ }

case 'unique': {
self.debug(`Column: ${column.name}, alter command unique`)
alterCommand = columnToAlter.unique()

@@ -148,0 +155,0 @@ break

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