{"action":"created","issue":{"url":"https://api.github.com/repos/flyway/flyway/issues/1393","repository_url":"https://api.github.com/repos/flyway/flyway","labels_url":"https://api.github.com/repos/flyway/flyway/issues/1393/labels{/name}","comments_url":"https://api.github.com/repos/flyway/flyway/issues/1393/comments","events_url":"https://api.github.com/repos/flyway/flyway/issues/1393/events","html_url":"https://github.com/flyway/flyway/pull/1393","id":169660785,"number":1393,"title":"Add the notion of optional migration which does not fail the entire migration process on error","user":{"login":"reda-alaoui","id":2890843,"avatar_url":"https://avatars.githubusercontent.com/u/2890843?v=3","gravatar_id":"","url":"https://api.github.com/users/reda-alaoui","html_url":"https://github.com/reda-alaoui","followers_url":"https://api.github.com/users/reda-alaoui/followers","following_url":"https://api.github.com/users/reda-alaoui/following{/other_user}","gists_url":"https://api.github.com/users/reda-alaoui/gists{/gist_id}","starred_url":"https://api.github.com/users/reda-alaoui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reda-alaoui/subscriptions","organizations_url":"https://api.github.com/users/reda-alaoui/orgs","repos_url":"https://api.github.com/users/reda-alaoui/repos","events_url":"https://api.github.com/users/reda-alaoui/events{/privacy}","received_events_url":"https://api.github.com/users/reda-alaoui/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flyway/flyway/labels/t:%20feature","name":"t: feature","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-05T17:49:50Z","updated_at":"2016-08-08T09:56:12Z","closed_at":"2016-08-08T06:01:36Z","pull_request":{"url":"https://api.github.com/repos/flyway/flyway/pulls/1393","html_url":"https://github.com/flyway/flyway/pull/1393","diff_url":"https://github.com/flyway/flyway/pull/1393.diff","patch_url":"https://github.com/flyway/flyway/pull/1393.patch"},"body":"Hello,\r\n\r\nI need a way to declare some sql migrations as optional to avoid full migration failure on those kind of SQL errors:\r\n- Trying to add an already existing column to a table\r\n- Trying to add an already existing table to a database\r\n- Trying to insert a duplicate row\r\n- Trying to drop non existing column from a table\r\n- etc ...\r\n\r\nTo give this option, I propose to change the migration file name pattern.\r\nThe pattern would change from `V1_2__Hello_World.sql` to:\r\n- `V1_2__optional__Hello_World.sql`\r\nOR\r\n- `V1_2__required__Hello_World.sql`\r\n\r\nCurrent and new patterns would be accepted to begin.\r\nCurrent one would be removed in version 6 for example.\r\n\r\nThe patch I propose is big. I am willing to modify any aspect.\r\n\r\nKind regards"},"comment":{"url":"https://api.github.com/repos/flyway/flyway/issues/comments/238192120","html_url":"https://github.com/flyway/flyway/pull/1393#issuecomment-238192120","issue_url":"https://api.github.com/repos/flyway/flyway/issues/1393","id":238192120,"user":{"login":"reda-alaoui","id":2890843,"avatar_url":"https://avatars.githubusercontent.com/u/2890843?v=3","gravatar_id":"","url":"https://api.github.com/users/reda-alaoui","html_url":"https://github.com/reda-alaoui","followers_url":"https://api.github.com/users/reda-alaoui/followers","following_url":"https://api.github.com/users/reda-alaoui/following{/other_user}","gists_url":"https://api.github.com/users/reda-alaoui/gists{/gist_id}","starred_url":"https://api.github.com/users/reda-alaoui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reda-alaoui/subscriptions","organizations_url":"https://api.github.com/users/reda-alaoui/orgs","repos_url":"https://api.github.com/users/reda-alaoui/repos","events_url":"https://api.github.com/users/reda-alaoui/events{/privacy}","received_events_url":"https://api.github.com/users/reda-alaoui/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T09:56:12Z","updated_at":"2016-08-08T09:56:12Z","body":"At our company, we have thousands of databases using the same schema.\r\nSometimes, data or structures can be altered by direct terminal manipulation or software bug over time.\r\nWhen we try to clean those databases, we know that our cleaning scripts can fail.\r\n\r\nIf the user is aware that optional means no guarantee of success, I don't see why it should be an issue. Aren't flyway end users assumed to be professionals?\r\n\r\nWithout this patch, the only way to pass those kind of sql scripts is to wrap them into pl/sql functions which catch every exception. This is not satisfying for us (and IMHO for many people).\r\n\r\nPerhaps we could add a status between success and failure in the meta table?"}}
{"actor":{"display_login":"reda-alaoui"}}