{"action":"closed","issue":{"url":"https://api.github.com/repos/Sylius/Sylius/issues/4248","repository_url":"https://api.github.com/repos/Sylius/Sylius","labels_url":"https://api.github.com/repos/Sylius/Sylius/issues/4248/labels{/name}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/4248/comments","events_url":"https://api.github.com/repos/Sylius/Sylius/issues/4248/events","html_url":"https://github.com/Sylius/Sylius/issues/4248","id":135368998,"number":4248,"title":"[review] - average rating NULL or 0 - model vs migration inconsistency","user":{"login":"nakashu","id":1550659,"avatar_url":"https://avatars.githubusercontent.com/u/1550659?v=3","gravatar_id":"","url":"https://api.github.com/users/nakashu","html_url":"https://github.com/nakashu","followers_url":"https://api.github.com/users/nakashu/followers","following_url":"https://api.github.com/users/nakashu/following{/other_user}","gists_url":"https://api.github.com/users/nakashu/gists{/gist_id}","starred_url":"https://api.github.com/users/nakashu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nakashu/subscriptions","organizations_url":"https://api.github.com/users/nakashu/orgs","repos_url":"https://api.github.com/users/nakashu/repos","events_url":"https://api.github.com/users/nakashu/events{/privacy}","received_events_url":"https://api.github.com/users/nakashu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Sylius/Sylius/labels/Bug","name":"Bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-22T09:52:22Z","updated_at":"2016-02-23T12:16:44Z","closed_at":"2016-02-23T12:16:44Z","body":"Generated migration for product.average_rating is `DEFAULT NULL` and model and mapping are for NOT NULL.\r\n\r\nWhat should be fixed, migration or model?\r\n\r\n\r\nMigration:\r\n```\r\n$this->addSql('ALTER TABLE sylius_product ADD average_rating DOUBLE PRECISION DEFAULT NULL');\r\n```\r\n\r\nMapping Product.orm.xml\r\n```\r\n<field name=\"averageRating\" column=\"average_rating\" type=\"float\" />\r\n```\r\n\r\nModel Product.php\r\n```\r\nprotected $averageRating = 0;\r\n```"}}