{"action":"created","issue":{"url":"https://api.github.com/repos/tractorcow-farm/silverstripe-fluent/issues/505","repository_url":"https://api.github.com/repos/tractorcow-farm/silverstripe-fluent","labels_url":"https://api.github.com/repos/tractorcow-farm/silverstripe-fluent/issues/505/labels{/name}","comments_url":"https://api.github.com/repos/tractorcow-farm/silverstripe-fluent/issues/505/comments","events_url":"https://api.github.com/repos/tractorcow-farm/silverstripe-fluent/issues/505/events","html_url":"https://github.com/tractorcow-farm/silverstripe-fluent/issues/505","id":417803459,"node_id":"MDU6SXNzdWU0MTc4MDM0NTk=","number":505,"title":"Postgres SiteTree_Localised  column \"locale\" does not exist","user":{"login":"wojciechmruk","id":6472147,"node_id":"MDQ6VXNlcjY0NzIxNDc=","avatar_url":"https://avatars0.githubusercontent.com/u/6472147?v=4","gravatar_id":"","url":"https://api.github.com/users/wojciechmruk","html_url":"https://github.com/wojciechmruk","followers_url":"https://api.github.com/users/wojciechmruk/followers","following_url":"https://api.github.com/users/wojciechmruk/following{/other_user}","gists_url":"https://api.github.com/users/wojciechmruk/gists{/gist_id}","starred_url":"https://api.github.com/users/wojciechmruk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojciechmruk/subscriptions","organizations_url":"https://api.github.com/users/wojciechmruk/orgs","repos_url":"https://api.github.com/users/wojciechmruk/repos","events_url":"https://api.github.com/users/wojciechmruk/events{/privacy}","received_events_url":"https://api.github.com/users/wojciechmruk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-03-06T13:29:00Z","updated_at":"2019-03-06T20:11:35Z","closed_at":null,"author_association":"NONE","body":"Hi, \r\nI'm using Postgres 9.2, Silverstripe 4.3 and fluent version is 4.2.0\r\n\r\nI've added a fluent module and dev/bulid?flush=all\r\n\r\nHere is an error:\r\n\r\n`[Emergency] Uncaught SilverStripe\\ORM\\Connect\\DatabaseException: Couldn't run query: SELECT \"RecordID\" FROM \"SiteTree_Localised\" WHERE (Locale = $1) ERROR: column \"locale\" does not exist LINE 3: WHERE (Locale = $1) ^\r\n`\r\n\r\nI Believe that the problem is here: \\tractorcow\\silverstripe-fluent\\src\\Extension\\FluentVersionedExtension.php in \"prepoulateIdsInLocale\" method.\r\n\r\nLine: 424\r\nOriginal:\r\n\r\n```\r\n            $select = SQLSelect::create(\r\n                ['\"RecordID\"'],\r\n                '\"' . $table . '\"',\r\n                ['Locale' => $locale]\r\n            );\r\n```\r\n\r\nIt is fine for MySql but not for Postgres and I think it should look like this:\r\n\r\n```\r\n            $select = SQLSelect::create(\r\n                ['\"RecordID\"'],\r\n                '\"' . $table . '\"',\r\n                ['\"Locale\"' => $locale]\r\n            );\r\n```\r\n\r\nLocale key should have \"\" like RecordID and $table has.\r\n\r\nI've tested only on Postgres and it works for me.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/tractorcow-farm/silverstripe-fluent/issues/comments/470258187","html_url":"https://github.com/tractorcow-farm/silverstripe-fluent/issues/505#issuecomment-470258187","issue_url":"https://api.github.com/repos/tractorcow-farm/silverstripe-fluent/issues/505","id":470258187,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3MDI1ODE4Nw==","user":{"login":"robbieaverill","id":5170590,"node_id":"MDQ6VXNlcjUxNzA1OTA=","avatar_url":"https://avatars1.githubusercontent.com/u/5170590?v=4","gravatar_id":"","url":"https://api.github.com/users/robbieaverill","html_url":"https://github.com/robbieaverill","followers_url":"https://api.github.com/users/robbieaverill/followers","following_url":"https://api.github.com/users/robbieaverill/following{/other_user}","gists_url":"https://api.github.com/users/robbieaverill/gists{/gist_id}","starred_url":"https://api.github.com/users/robbieaverill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbieaverill/subscriptions","organizations_url":"https://api.github.com/users/robbieaverill/orgs","repos_url":"https://api.github.com/users/robbieaverill/repos","events_url":"https://api.github.com/users/robbieaverill/events{/privacy}","received_events_url":"https://api.github.com/users/robbieaverill/received_events","type":"User","site_admin":false},"created_at":"2019-03-06T20:11:35Z","updated_at":"2019-03-06T20:11:35Z","author_association":"COLLABORATOR","body":"Thanks for the bug report. Would you like to change this into a pull request? We have unit tests that run in Postgres too, so I assume that this part of the code isn't covered by existing unit tests. If you could add a new unit test to cover this code too that'd be even better, but a patch would be great anyway!"}}
{"actor":{"display_login":"robbieaverill"}}