{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/scenic/issues/154","repository_url":"https://api.github.com/repos/thoughtbot/scenic","labels_url":"https://api.github.com/repos/thoughtbot/scenic/issues/154/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/scenic/issues/154/comments","events_url":"https://api.github.com/repos/thoughtbot/scenic/issues/154/events","html_url":"https://github.com/thoughtbot/scenic/issues/154","id":156837411,"number":154,"title":"Generating updates to materialized views","user":{"login":"lperiodbose","id":2452922,"avatar_url":"https://avatars.githubusercontent.com/u/2452922?v=3","gravatar_id":"","url":"https://api.github.com/users/lperiodbose","html_url":"https://github.com/lperiodbose","followers_url":"https://api.github.com/users/lperiodbose/followers","following_url":"https://api.github.com/users/lperiodbose/following{/other_user}","gists_url":"https://api.github.com/users/lperiodbose/gists{/gist_id}","starred_url":"https://api.github.com/users/lperiodbose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lperiodbose/subscriptions","organizations_url":"https://api.github.com/users/lperiodbose/orgs","repos_url":"https://api.github.com/users/lperiodbose/repos","events_url":"https://api.github.com/users/lperiodbose/events{/privacy}","received_events_url":"https://api.github.com/users/lperiodbose/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-25T20:00:40Z","updated_at":"2016-05-26T01:56:19Z","closed_at":null,"body":"When I update a view as so...\r\n\r\n```\r\n$ rails generate scenic:view recipient_search_results\r\n      create  db/views/recipient_search_results_v03.sql\r\n      create  db/migrate/20160525194954_update_recipient_search_results_to_version_3.rb\r\n```\r\n\r\n...the generated migration doesn't have the `materialized: true` option on it, even though the view being replaced was previously materialized.\r\n\r\nWhen I subsequently...\r\n\r\n```\r\n$ rails db:migrate\r\n== 20160525194954 UpdateRecipientSearchResultsToVersion3: migrating ===========\r\n-- update_view(:recipient_search_results, {:version=>3, :revert_to_version=>2})\r\nrails aborted!\r\nStandardError: An error has occurred, this and all later migrations canceled:\r\n\r\nPG::WrongObjectType: ERROR:  \"recipient_search_results\" is not a view\r\nHINT:  Use DROP MATERIALIZED VIEW to remove a materialized view.\r\n\r\n```\r\n\r\n...this missing option throws an (understandable) error.\r\n\r\nWould it be desirable for a generated migration in this instance to have `materialized: true' by default? If so, I'd be happy to take a swing at a PR..."},"comment":{"url":"https://api.github.com/repos/thoughtbot/scenic/issues/comments/221757866","html_url":"https://github.com/thoughtbot/scenic/issues/154#issuecomment-221757866","issue_url":"https://api.github.com/repos/thoughtbot/scenic/issues/154","id":221757866,"user":{"login":"magicalbanana","id":7953984,"avatar_url":"https://avatars.githubusercontent.com/u/7953984?v=3","gravatar_id":"","url":"https://api.github.com/users/magicalbanana","html_url":"https://github.com/magicalbanana","followers_url":"https://api.github.com/users/magicalbanana/followers","following_url":"https://api.github.com/users/magicalbanana/following{/other_user}","gists_url":"https://api.github.com/users/magicalbanana/gists{/gist_id}","starred_url":"https://api.github.com/users/magicalbanana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicalbanana/subscriptions","organizations_url":"https://api.github.com/users/magicalbanana/orgs","repos_url":"https://api.github.com/users/magicalbanana/repos","events_url":"https://api.github.com/users/magicalbanana/events{/privacy}","received_events_url":"https://api.github.com/users/magicalbanana/received_events","type":"User","site_admin":false},"created_at":"2016-05-26T01:56:19Z","updated_at":"2016-05-26T01:56:19Z","body":"Hmm, in my opinion I think it's better that this throws an error because leaving this as a default contradicts the default option that's already used when generating the views. This error also gives you a better understanding of the migrations that relate to the views you have."}}
{"actor":{"display_login":"magicalbanana"}}