{"action":"opened","issue":{"url":"https://api.github.com/repos/flyway/flyway-play/issues/29","repository_url":"https://api.github.com/repos/flyway/flyway-play","labels_url":"https://api.github.com/repos/flyway/flyway-play/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/flyway/flyway-play/issues/29/comments","events_url":"https://api.github.com/repos/flyway/flyway-play/issues/29/events","html_url":"https://github.com/flyway/flyway-play/issues/29","id":147693585,"number":29,"title":"FileNotFoundException when using locations with manual migration","user":{"login":"lunaryorn","id":224922,"avatar_url":"https://avatars.githubusercontent.com/u/224922?v=3","gravatar_id":"","url":"https://api.github.com/users/lunaryorn","html_url":"https://github.com/lunaryorn","followers_url":"https://api.github.com/users/lunaryorn/followers","following_url":"https://api.github.com/users/lunaryorn/following{/other_user}","gists_url":"https://api.github.com/users/lunaryorn/gists{/gist_id}","starred_url":"https://api.github.com/users/lunaryorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lunaryorn/subscriptions","organizations_url":"https://api.github.com/users/lunaryorn/orgs","repos_url":"https://api.github.com/users/lunaryorn/repos","events_url":"https://api.github.com/users/lunaryorn/events{/privacy}","received_events_url":"https://api.github.com/users/lunaryorn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-12T09:43:02Z","updated_at":"2016-04-12T09:43:02Z","closed_at":null,"body":"Hello,\r\n\r\nwe are using flyway-play with the following configuration in \"development mode\" (e.g. `sbt run`):\r\n\r\n```\r\ndb.default.migrations.locations=[\"prod\", \"stage\"]\r\ndb.default.migrations.auto=false\r\n```\r\n\r\nUnfortunately flyway-play crashes with a `FileNotFoundException` in this scenario ([stacktrace](https://gist.github.com/lunaryorn/4e862b7a3a5e08c3252401776403ede1)) when pending migrations exist.  Note that the crash does not occur when\r\n\r\n- we run our unit tests against the database (e.g. `Mode.Test`),\r\n- when we enable `db.default.migrations.auto=true`,\r\n- when we do not use `locations` at all,\r\n- or when all migrations are successfully applied.\r\n\r\nI think the root cause is that `PlayInitializer.migrationDescriptionToShow` does not take `locations` into account when trying to read the migration file for the message.  Hence the error only occurs when the migrations are not applied automatically because `checkState` and thus `migrationDescriptionToShow` are never invoked in this case, or when there are no pending migrations because in this case `checkState` doesn't call `migrationDescriptionToShow`."}}