Socket
Socket
Sign inDemoInstall

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.3 to 1.0.4

5

package.json
{
"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",

11

src/index.js

@@ -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

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