feathers-knex-modeler
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "feathers-knex-modeler", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "This package allows you to easily extend a table while you are developing it without requiring you to drop tables.", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "mocha --timeout 1000" | ||
"test": "mocha --timeout 5000" | ||
}, | ||
@@ -17,2 +17,3 @@ "keywords": [], | ||
"debug": "^4.1.0", | ||
"delay": "^4.1.0", | ||
"lodash": "^4.17.11", | ||
@@ -19,0 +20,0 @@ "p-queue": "^3.0.0", |
@@ -96,3 +96,10 @@ /* eslint-disable no-console */ | ||
let argument = option.argument | ||
let columnToAlter = table[column.type](column.name) | ||
let columnToAlter | ||
if (_.isArray(column.args) === true && _.isString(column.args) === false) { | ||
columnToAlter = table[column.type](column.name, ...column.args) | ||
} else if (_.isUndefined(column.args) === true) { | ||
columnToAlter = table[column.type](column.name, column.args) | ||
} else { | ||
columnToAlter = table[column.type](column.name) | ||
} | ||
@@ -205,3 +212,3 @@ switch (typeOfColumn) { | ||
const self = this | ||
await pWaitFor(() => self.hasTable(tableName)) | ||
await pWaitFor(async () => self.hasTable(tableName)) | ||
return self.hasTable(tableName) | ||
@@ -208,0 +215,0 @@ } |
@@ -31,3 +31,3 @@ { | ||
"name": "dependent", | ||
"depends": [], | ||
"depends": ["test"], | ||
"columns": [ | ||
@@ -34,0 +34,0 @@ { "name": "id", "type": "increments" }, |
/* eslint-disable no-undef */ | ||
'use strict' | ||
const expect = require('chai').expect | ||
const delay = require('delay') | ||
const fixtures = require('./fixtures.json') | ||
const Modeler = require('../src/index.js') | ||
const knex = require('knex') | ||
const db = knex({ | ||
client: 'pg', | ||
connection: { | ||
host: '127.0.0.1', | ||
database: 'myapp_test' | ||
} | ||
}) | ||
after(function (done) { | ||
db.destroy() | ||
done(process.exit()) | ||
}) | ||
describe('Feathers-Knex-Modeller', () => { | ||
before(function (done) { | ||
db.schema.hasTable(fixtures.testTwo.name) | ||
.then((hasTable) => { | ||
if (hasTable === true) { | ||
return db.raw(`drop table ${fixtures.testTwo.name}`) | ||
} | ||
}) | ||
.then(() => db.schema.hasTable(fixtures.testOne.name)) | ||
.then((hasTable) => { | ||
if (hasTable === true) { | ||
return db.raw(`drop table ${fixtures.testOne.name}`) | ||
} | ||
}) | ||
.then((data) => { | ||
return done() | ||
}) | ||
}) | ||
after(function (done) { | ||
db.destroy() | ||
done(process.exit()) | ||
}) | ||
const db = knex({ | ||
client: 'pg', | ||
connection: { | ||
host: '127.0.0.1', | ||
database: 'myapp_test' | ||
} | ||
}) | ||
let testOne = fixtures.testOne | ||
@@ -39,0 +22,0 @@ let testTwo = fixtures.testTwo |
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
15539
5
389
+ Addeddelay@^4.1.0
+ Addeddelay@4.4.1(transitive)