{"action":"created","issue":{"url":"https://api.github.com/repos/rubenv/sql-migrate/issues/43","repository_url":"https://api.github.com/repos/rubenv/sql-migrate","labels_url":"https://api.github.com/repos/rubenv/sql-migrate/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/rubenv/sql-migrate/issues/43/comments","events_url":"https://api.github.com/repos/rubenv/sql-migrate/issues/43/events","html_url":"https://github.com/rubenv/sql-migrate/issues/43","id":185966084,"node_id":"MDU6SXNzdWUxODU5NjYwODQ=","number":43,"title":"Behavior when unknown migration","user":{"login":"ericklaus-wf","id":3606221,"node_id":"MDQ6VXNlcjM2MDYyMjE=","avatar_url":"https://avatars0.githubusercontent.com/u/3606221?v=4","gravatar_id":"","url":"https://api.github.com/users/ericklaus-wf","html_url":"https://github.com/ericklaus-wf","followers_url":"https://api.github.com/users/ericklaus-wf/followers","following_url":"https://api.github.com/users/ericklaus-wf/following{/other_user}","gists_url":"https://api.github.com/users/ericklaus-wf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericklaus-wf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericklaus-wf/subscriptions","organizations_url":"https://api.github.com/users/ericklaus-wf/orgs","repos_url":"https://api.github.com/users/ericklaus-wf/repos","events_url":"https://api.github.com/users/ericklaus-wf/events{/privacy}","received_events_url":"https://api.github.com/users/ericklaus-wf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-28T16:29:40Z","updated_at":"2018-07-04T11:14:34Z","closed_at":"2018-07-04T11:14:34Z","author_association":"NONE","body":"sql-migrate behaves badly when the database has migrations \"unknown\" to the current run of sql-migrate. This is most likely to happen when a diverged branch applied its migrations to a database while another branch also applied its own migrations to a database.\n\nFor example:\n1. branch A: 1, 2, 3\n2. branch B: 1, 2, 4\n3. branch B applies against DB. State is now \"1, 2, 4\"\n4. branch A tries to apply against DB. Migration \"4\" is unknown.\n\nSee existing issue: https://github.com/rubenv/sql-migrate/issues/37\n\nHow should sql-migrate behave when asked to perform a migration against a database that has unknown migrations? I can think of two reasonable behaviors:\n1. Complain that unknown migrations exist. Require the user to pass a -f force flag to complete the migrations. I'm not sure how the library should change, but I could work up some suggestions.\n2. Do the best we can. When migrating up, ignore the unknown migrations. When migrating down, fail upon encountering an unknown migration.\n\n(For option 2, we could also allow migrating down by adding a migrate_down column to the migrations table and storing the SQL at migrate up time. That doesn't help any existing installations, but would be a way forward.)\n\nWhich behavior seems best? I'm in favor of 2, but see the merits of 1.\n"},"comment":{"url":"https://api.github.com/repos/rubenv/sql-migrate/issues/comments/402448144","html_url":"https://github.com/rubenv/sql-migrate/issues/43#issuecomment-402448144","issue_url":"https://api.github.com/repos/rubenv/sql-migrate/issues/43","id":402448144,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjQ0ODE0NA==","user":{"login":"rubenv","id":42904,"node_id":"MDQ6VXNlcjQyOTA0","avatar_url":"https://avatars0.githubusercontent.com/u/42904?v=4","gravatar_id":"","url":"https://api.github.com/users/rubenv","html_url":"https://github.com/rubenv","followers_url":"https://api.github.com/users/rubenv/followers","following_url":"https://api.github.com/users/rubenv/following{/other_user}","gists_url":"https://api.github.com/users/rubenv/gists{/gist_id}","starred_url":"https://api.github.com/users/rubenv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubenv/subscriptions","organizations_url":"https://api.github.com/users/rubenv/orgs","repos_url":"https://api.github.com/users/rubenv/repos","events_url":"https://api.github.com/users/rubenv/events{/privacy}","received_events_url":"https://api.github.com/users/rubenv/received_events","type":"User","site_admin":false},"created_at":"2018-07-04T11:14:34Z","updated_at":"2018-07-04T11:14:34Z","author_association":"OWNER","body":"Fix is merged thanks to @ironsmile!"}}
{"actor":{"display_login":"rubenv"}}