Skip to content

Programmable API createDatabase arguments are overridden #578

Open
@tjokimie

Description

@tjokimie

I'm submitting a...

  • Bug report
  • Feature request
  • Question

Current behavior

Command line parameters override createDatabase parameters in Programable API.

$ DATABASE_URL=postgres://localhost/postgres node index.js
[INFO] Created database "expected"
$ DATABASE_URL=postgres://localhost/postgres node index.js unexpected
[INFO] Created database "unexpected"

Expected behavior

I would expect parameters provided to createDatabase always override possible command line arguments.

$ DATABASE_URL=postgres://localhost/postgres node index.js
[INFO] Created database "expected"
$ DATABASE_URL=postgres://localhost/postgres node index.js unexpected
[INFO] Created database "expected"

Minimal reproduction of the problem with instructions

$ cat index.js
var dbmigrate = require('db-migrate');
var dbm = dbmigrate.getInstance(true);
dbm.createDatabase('expected')
.then(function() {
  process.exit(0);
});

What is the motivation / use case for changing the behavior?

Using createDatabase through Programable API in an program that has command line args is not possible at the moment.

Environment

db-migrate version: 0.11.1
db-migrate-pg version: 0.4.0

Additional information:
- Node version: v10.6.0
- Platform:  Mac

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions