Skip to content

Callback to getInstance not called #546

Closed
@cellis

Description

@cellis

I'm submitting a...

  • [x ] Bug report
  • Feature request
  • Question

Current behavior

When I run the script yarn migrate up and there are no migrations I recieve:

$ babel-node ./internal/tools/migrate up
[INFO] No migrations to run
callback was called

However, if there are migrations or I run yarn migrate create some-migration, this happens:

$ babel-node ./internal/tools/migrate create some-migration
[INFO] Created migration at /migrations/20180210210707-some-migration.js
[INFO] Created migration up sql file at /migrations/sqls/20180210210707-some-migration-up.sql
[INFO] Created migration down sql file at /migrations/sqls/20180210210707-some-migration-down.sql
✨  Done in 2.19s.

Note that the callback was never called in the second example

My code is as follows:

require('db-migrate').getInstance(false, migrateConfig, () => {
  console.log('callback was called'); // never called
}).run();

Expected behavior

I expect a callback passed to getInstance to be called.

Minimal reproduction of the problem with instructions

I have a file called migrate.js with the above code inside. I'm executing it like this:

$ node migrate.js

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

I would like to be able to run some additional tasks after the database is migrated.

Environment


db-migrate-pg: "0.3.0",
plugins with versions: X.Y.Z
db-migrate driver with versions: 

Additional information:
- Node version: 9.2.0  
- Platform: MAC  

Others:

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