Skip to content

How to make migration task fail for missing migrations? #32

@micheal-hill

Description

@micheal-hill

I'm trying to have flyway/sbt produce an error (rather than a warning) when migrations are missing, but I haven't been able to find any options that would present this behavior. Specifically, I would like sbt to exit with a non-zero exit status if a migration is missing - the same behavior as when a migration has been modified after apply.

Is there some setting/configuration that I can change to do this?

> sbt flyway/flywayMigrate
[info] Loading settings for project global-plugins from idea.sbt ...
[info] Loading global plugins from __user__/.sbt/1.0/plugins
[info] Loading project definition from __user__/flyway_spike/project/project
[info] Loading settings for project flyway_spike-build from plugins.sbt ...
[info] Loading project definition from __user__/flyway_spike/project
[info] Loading settings for project flyway from build.sbt ...
[info] Loading settings for project flyway_spike from build.sbt ...
[info] Set current project to flyway_spike (in build file:__user__/flyway_spike/)
[info] Flyway Community Edition 5.2.0 by Boxfuse
[info] Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 10.5)
[info] Successfully validated 1 migration (execution time 00:00.014s)
[info] Current version of schema "public": 20181018
[warn] Schema "public" has version 20181018, but no migration could be resolved in the configured locations !
[info] Schema "public" is up to date. No migration necessary.
[success] Total time: 0 s, completed 19/10/2018 12:58:17 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions