{"action":"opened","issue":{"url":"https://api.github.com/repos/jfqd/redmine_helpdesk/issues/66","labels_url":"https://api.github.com/repos/jfqd/redmine_helpdesk/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/jfqd/redmine_helpdesk/issues/66/comments","events_url":"https://api.github.com/repos/jfqd/redmine_helpdesk/issues/66/events","html_url":"https://github.com/jfqd/redmine_helpdesk/issues/66","id":64229209,"number":66,"title":"Migration issues with PostgreSQL","user":{"login":"vilppuvuorinen","id":8420095,"avatar_url":"https://avatars.githubusercontent.com/u/8420095?v=3","gravatar_id":"","url":"https://api.github.com/users/vilppuvuorinen","html_url":"https://github.com/vilppuvuorinen","followers_url":"https://api.github.com/users/vilppuvuorinen/followers","following_url":"https://api.github.com/users/vilppuvuorinen/following{/other_user}","gists_url":"https://api.github.com/users/vilppuvuorinen/gists{/gist_id}","starred_url":"https://api.github.com/users/vilppuvuorinen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vilppuvuorinen/subscriptions","organizations_url":"https://api.github.com/users/vilppuvuorinen/orgs","repos_url":"https://api.github.com/users/vilppuvuorinen/repos","events_url":"https://api.github.com/users/vilppuvuorinen/events{/privacy}","received_events_url":"https://api.github.com/users/vilppuvuorinen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-25T09:45:17Z","updated_at":"2015-03-25T09:45:17Z","closed_at":null,"body":"Current migrations trigger ```PG:DuplicateColumn``` errors if the migrations are run twice. This can cause problems if there happens to be a need to update the plugin migrations in the future.\r\n\r\n##### How to reproduce\r\n* Setup postgresql backend\r\n* run ```rake db:migrate```\r\n* run ```rake redmine:plugins:migrate``` twice\r\n\r\n##### Caused by\r\n```end_to_owner``` column is added blindly:\r\nhttps://github.com/jfqd/redmine_helpdesk/blob/7f449ff45/db/migrate/001_create_custom_owner_email_field.rb#L3\r\n\r\nMySQLand SQlite3 don't seem to mind this at all.\r\n\r\n##### Proposed fix\r\nAdd ```column_exists?``` check:\r\nhttp://stackoverflow.com/a/5958436/2661603"}}