feathers-knex-modeler
Advanced tools
Comparing version 1.0.12 to 1.3.0
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20173
510