Does anyone else's Community CLI not work?

jahmezzjahmezz Posts: 4 New member
edited April 12, 2024 7:10AM in Flyway (General Discussion)
Hello,

I installed Flyway Community to get access to the Flyway CLI so I can run "flyway migrate".

I found in our current project's setup (it runs "flyway migrate" without any config files), this wasn't doing anything.

I uninstalled Community and installed the CLI instead. https://documentation.red-gate.com/fd/command-line-184127404.html

This worked.

Anyone else have this?

Thank you.
Tagged:

Best Answers

  • Peter_LawsPeter_Laws Posts: 273 Silver 2
    Given it's PowerShell, you're most likely not seeing the debug output because the default PowerShell debug settings are to just silently continue without showing you anything. (source)

    Additionally if you add -X to the end of your command you'll enable flyways debug output, it still requires PS debug to be enabled, but you'll get a lot more info.

    One of the reasons you provide the application is to take care of these things for you.
    If you find an exception in your debug output, I'd be happy to take a look for you.
    Kind regards
    Peter Laws | Redgate Software
    Have you visited our Help Center?
  • jahmezzjahmezz Posts: 4 New member
    edited April 14, 2024 3:49AM Answer ✓
    EDIT: Your comments were right. The table name was wrong, causing the error. Debug output being on would have saved me. Thank you.

    Tried it again on another computer that had Flyway Desktop installed.

    Using Command Prompt...

    flyway -X migrate -url=jdbc:postgresql://localhost:5432/database -locations=filesystem:./migrations -user=postgres -password=postgres

    No output.

    Even doing flyway version has no output.

    flyway by itself outputs the help information.

    Here is screenshot of the Flyway Desktop About screen on my computer. https://postimg.cc/t17rPfSP

    The remaining database update to do was this...

    ALTER TABLE table
        ADD COLUMN column10 NOT NULL DEFAULT 0;

    After running flyway migrate, this does not apply. The flyway schema history remains unchanged.

    But as I mention in the first comment, after uninstalling Flyway Desktop and installing the CLI, it worked just fine.

Answers

  • Hi jahmezz,

    When you say Flyway Community, do you mean Flyway Desktop, community edition?
    (There's a flyway cli community edition as well)

    I would not expect migrate to proceed without any config as it wouldn't have a target. I'd be happy to reproduce the test if you can please give us a little more detail.
    Kind regards
    Peter Laws | Redgate Software
    Have you visited our Help Center?
  • jahmezzjahmezz Posts: 4 New member
    edited April 12, 2024 8:10AM
    Yes. I have inherited a codebase and the upgrade database script runs this.

    powershell flyway -outOfOrder="true" migrate -url=jdbc:postgresql://${host}:${port}/${database} -locations=filesystem:./${MIGRATION_FOLDER} -user=${user} ${passwordSection}

    When I ran this, I saw no debug statements at all. Just a silent end of the program.

    But when I uninstalled Flyway Desktop Community and installed Flyway CLI for Windows, it showed me printed logs and completed the migration just fine.

    More information about things...

    1. The migrations folder was a simple child folder ./migration
    2. The DB is postgres at localhost:5432, username postgres, password postgres...
    3. The migration itself was ALTER TABLE add one column to the table.

    It just wouldn't run. But the CLI download would.
  • Excellent news jahmezz !

    The version of Flyway Desktop you have, where did you pull it down from please?
    I'd expect a slightly newer version to be available and want to check all our available sources are current.

    Thanks!
    Kind regards
    Peter Laws | Redgate Software
    Have you visited our Help Center?
  • jahmezzjahmezz Posts: 4 New member
    I signed up for Flyway Community and followed the install wizard. I assume that I am using an outdated version because I installed it in late January.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file