{"action":"opened","issue":{"url":"https://api.github.com/repos/milkyway-multimedia/ss-shop-inventory/issues/12","repository_url":"https://api.github.com/repos/milkyway-multimedia/ss-shop-inventory","labels_url":"https://api.github.com/repos/milkyway-multimedia/ss-shop-inventory/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/milkyway-multimedia/ss-shop-inventory/issues/12/comments","events_url":"https://api.github.com/repos/milkyway-multimedia/ss-shop-inventory/issues/12/events","html_url":"https://github.com/milkyway-multimedia/ss-shop-inventory/issues/12","id":133587197,"number":12,"title":"TrackStockOnBuyable: Cannot purchase ProductVariations","user":{"login":"samthejarvis","id":1410549,"avatar_url":"https://avatars.githubusercontent.com/u/1410549?v=3","gravatar_id":"","url":"https://api.github.com/users/samthejarvis","html_url":"https://github.com/samthejarvis","followers_url":"https://api.github.com/users/samthejarvis/followers","following_url":"https://api.github.com/users/samthejarvis/following{/other_user}","gists_url":"https://api.github.com/users/samthejarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/samthejarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samthejarvis/subscriptions","organizations_url":"https://api.github.com/users/samthejarvis/orgs","repos_url":"https://api.github.com/users/samthejarvis/repos","events_url":"https://api.github.com/users/samthejarvis/events{/privacy}","received_events_url":"https://api.github.com/users/samthejarvis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-14T22:23:01Z","updated_at":"2016-02-14T22:23:01Z","closed_at":null,"body":"When decrementStock is called, the following code\r\nTrackStockOnBuyable.php:198\r\n```\r\nif ($this->owner->hasExtension('Versioned')) {\r\n    $this->owner->writeToStage('Stage');\r\n    $this->owner->publish('Stage', 'Live');\r\n}\r\n```\r\nCauses an SQL error ('xxx.ProductVariation_Stage' doesn't exist) because ProductVariations only have a Live table.\r\n\r\nFrom ProductVariation.php:\r\n```\r\nprivate static $versioning = array(\r\n\t\t'Live'\r\n\t);\r\n\r\n\tprivate static $extensions = array(\r\n\t\t\"Versioned('Live')\"\r\n\t);\r\n```"}}