node-flywaydb icon indicating copy to clipboard operation
node-flywaydb copied to clipboard

Flyway is not following through command when version is updating

Open yoavain-sundaysky opened this issue 4 years ago • 5 comments

I'm running the command

flyway --configfile=db/conf/flyway.js migrate

Every time there's a new version, the migrate (or any other command) does not complete after the download finishes. When running the command again, the migrate is completed. As a workaround, we run flyway info before the migrate.

You can reproduce this by setting in the config file a version other than the one currently installed. E.g.:

{    
    "downloads": {
        "expirationTimeInMs": 0
    },
    "version": "8.2.0"
}

(Or by deleting the content of the jlib folder)

Environment:

  • OS: Windows 10
  • NodeJS: 14.18.2
  • node-flywaydb: 3.0.7

1st run log:

DOWNLOADING https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/8.2.0/flyway-commandline-8.2.0-windows-x64.zip

2nd run log:

A new version of Flyway is available
Upgrade to Flyway 8.2.1: https://rd.gt/2X0gakb
Flyway Community Edition 8.2.0 by Redgate
Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 10.17)
Successfully validated 208 migrations (execution time 00:00.177s)
Current version of schema "public": 1.200
Schema "public" is up to date. No migration necessary.

yoavain-sundaysky avatar Dec 08 '21 09:12 yoavain-sundaysky

Looking at the code, it seems that you use extract-zip in the old callback-style API, which is deprecated as of version 2.0.0 https://github.com/maxogden/extract-zip/releases/tag/v2.0.0

yoavain-sundaysky avatar Dec 08 '21 10:12 yoavain-sundaysky

Opened a PR https://github.com/markgardner/node-flywaydb/pull/35

yoavain-sundaysky avatar Dec 08 '21 11:12 yoavain-sundaysky

Is the callback pattern causing the problem?

markgardner avatar Dec 09 '21 20:12 markgardner

Right, they changed the callback api to a promise api. so the callback passed as the 3rd parameter is never called.

yoavain avatar Dec 10 '21 06:12 yoavain

Any update on this?

yoavain avatar Jan 26 '22 18:01 yoavain