{"action":"created","issue":{"url":"https://api.github.com/repos/strapi/strapi/issues/1762","repository_url":"https://api.github.com/repos/strapi/strapi","labels_url":"https://api.github.com/repos/strapi/strapi/issues/1762/labels{/name}","comments_url":"https://api.github.com/repos/strapi/strapi/issues/1762/comments","events_url":"https://api.github.com/repos/strapi/strapi/issues/1762/events","html_url":"https://github.com/strapi/strapi/issues/1762","id":351236502,"node_id":"MDU6SXNzdWUzNTEyMzY1MDI=","number":1762,"title":"Can't customize Primary Key on bookshelf","user":{"login":"ferminmine","id":7171819,"node_id":"MDQ6VXNlcjcxNzE4MTk=","avatar_url":"https://avatars2.githubusercontent.com/u/7171819?v=4","gravatar_id":"","url":"https://api.github.com/users/ferminmine","html_url":"https://github.com/ferminmine","followers_url":"https://api.github.com/users/ferminmine/followers","following_url":"https://api.github.com/users/ferminmine/following{/other_user}","gists_url":"https://api.github.com/users/ferminmine/gists{/gist_id}","starred_url":"https://api.github.com/users/ferminmine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferminmine/subscriptions","organizations_url":"https://api.github.com/users/ferminmine/orgs","repos_url":"https://api.github.com/users/ferminmine/repos","events_url":"https://api.github.com/users/ferminmine/events{/privacy}","received_events_url":"https://api.github.com/users/ferminmine/received_events","type":"User","site_admin":false},"labels":[{"id":749108959,"node_id":"MDU6TGFiZWw3NDkxMDg5NTk=","url":"https://api.github.com/repos/strapi/strapi/labels/priority:%20medium","name":"priority: medium","color":"fbc307","default":false},{"id":783919370,"node_id":"MDU6TGFiZWw3ODM5MTkzNzA=","url":"https://api.github.com/repos/strapi/strapi/labels/status:%20confirmed","name":"status: confirmed","color":"215cea","default":false},{"id":267208743,"node_id":"MDU6TGFiZWwyNjcyMDg3NDM=","url":"https://api.github.com/repos/strapi/strapi/labels/type:%20bug%20%F0%9F%90%9B","name":"type: bug 🐛","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":{"login":"lauriejim","id":5716596,"node_id":"MDQ6VXNlcjU3MTY1OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/5716596?v=4","gravatar_id":"","url":"https://api.github.com/users/lauriejim","html_url":"https://github.com/lauriejim","followers_url":"https://api.github.com/users/lauriejim/followers","following_url":"https://api.github.com/users/lauriejim/following{/other_user}","gists_url":"https://api.github.com/users/lauriejim/gists{/gist_id}","starred_url":"https://api.github.com/users/lauriejim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauriejim/subscriptions","organizations_url":"https://api.github.com/users/lauriejim/orgs","repos_url":"https://api.github.com/users/lauriejim/repos","events_url":"https://api.github.com/users/lauriejim/events{/privacy}","received_events_url":"https://api.github.com/users/lauriejim/received_events","type":"User","site_admin":false},"assignees":[{"login":"lauriejim","id":5716596,"node_id":"MDQ6VXNlcjU3MTY1OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/5716596?v=4","gravatar_id":"","url":"https://api.github.com/users/lauriejim","html_url":"https://github.com/lauriejim","followers_url":"https://api.github.com/users/lauriejim/followers","following_url":"https://api.github.com/users/lauriejim/following{/other_user}","gists_url":"https://api.github.com/users/lauriejim/gists{/gist_id}","starred_url":"https://api.github.com/users/lauriejim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauriejim/subscriptions","organizations_url":"https://api.github.com/users/lauriejim/orgs","repos_url":"https://api.github.com/users/lauriejim/repos","events_url":"https://api.github.com/users/lauriejim/events{/privacy}","received_events_url":"https://api.github.com/users/lauriejim/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2018-08-16T14:43:19Z","updated_at":"2019-01-03T07:10:37Z","closed_at":null,"author_association":"NONE","body":"**Informations**\r\n- **Node.js**: 10.0.8\r\n- **npm**: 6.2.0\r\n- **Strapi**: 3.0.0-alpha.13.1\r\n- **Database**: MySQL\r\n- **Operating system**: Ubuntu 18.04\r\n\r\n\r\n**What is the current behavior?**\r\nI'm using Strapi to connect with an existing table in a MySQL table. Sadly, the id column of such table it's not called `id`, it's called `work_id`. To solve this I used in my model's JSON settings file the following configuration:\r\n```\r\n{\r\n  \"connection\": \"default\",\r\n  \"collectionName\": \"works\",\r\n  \"primaryKey\": \"work_id\",\r\n  \"info\": {\r\n    \"name\": \"Works\",\r\n    \"description\": \"\",\r\n    \"mainField\": \"work_id\"\r\n  },\r\n  \"attributes\": {\r\n    \"work_id\": {\r\n      \"type\": \"integer\",\r\n      \"required\": true\r\n    },\r\n   ...\r\n```\r\nIt lists the objects from the database well, but when I try to enter the details of an object it throws an error saying: ``\r\nError: Undefined binding(s) detected when compiling SELECT query: select `works`.* from `works` where `works`.`work_id` = ? limit ?`\r\n``\r\n\r\n**Steps to reproduce the problem**\r\nConnect to an existing table of a database using a different PK name.\r\n\r\n\r\n**What is the expected behavior?**\r\nI should be able to enter the detail view of the object from that type of content.\r\n\r\n\r\n**Suggested solutions**\r\nI'm not sure!\r\n"},"comment":{"url":"https://api.github.com/repos/strapi/strapi/issues/comments/451069008","html_url":"https://github.com/strapi/strapi/issues/1762#issuecomment-451069008","issue_url":"https://api.github.com/repos/strapi/strapi/issues/1762","id":451069008,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTA2OTAwOA==","user":{"login":"chaitanyya","id":13115490,"node_id":"MDQ6VXNlcjEzMTE1NDkw","avatar_url":"https://avatars0.githubusercontent.com/u/13115490?v=4","gravatar_id":"","url":"https://api.github.com/users/chaitanyya","html_url":"https://github.com/chaitanyya","followers_url":"https://api.github.com/users/chaitanyya/followers","following_url":"https://api.github.com/users/chaitanyya/following{/other_user}","gists_url":"https://api.github.com/users/chaitanyya/gists{/gist_id}","starred_url":"https://api.github.com/users/chaitanyya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaitanyya/subscriptions","organizations_url":"https://api.github.com/users/chaitanyya/orgs","repos_url":"https://api.github.com/users/chaitanyya/repos","events_url":"https://api.github.com/users/chaitanyya/events{/privacy}","received_events_url":"https://api.github.com/users/chaitanyya/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T07:10:37Z","updated_at":"2019-01-03T07:10:37Z","author_association":"NONE","body":"I believe that's `idAttributeType`, from the documentation: \r\n\r\n> **idAttribute:** This tells the model which attribute to expect as the unique identifier for each database row (typically an auto-incrementing primary key named 'id'). Only valid for strapi-hook-bookshelf\r\n\r\nThis seems very similar to what `primaryKey` does. Is there a reason for having them both?"}}
{"actor":{"display_login":"chaitanyya"}}