{"action":"created","issue":{"url":"https://api.github.com/repos/gabordemooij/redbean/issues/465","labels_url":"https://api.github.com/repos/gabordemooij/redbean/issues/465/labels{/name}","comments_url":"https://api.github.com/repos/gabordemooij/redbean/issues/465/comments","events_url":"https://api.github.com/repos/gabordemooij/redbean/issues/465/events","html_url":"https://github.com/gabordemooij/redbean/issues/465","id":104063716,"number":465,"title":"redbean places too many constraints on foreign keys, resulting in unremovable records","user":{"login":"r3wt","id":4483325,"avatar_url":"https://avatars.githubusercontent.com/u/4483325?v=3","gravatar_id":"","url":"https://api.github.com/users/r3wt","html_url":"https://github.com/r3wt","followers_url":"https://api.github.com/users/r3wt/followers","following_url":"https://api.github.com/users/r3wt/following{/other_user}","gists_url":"https://api.github.com/users/r3wt/gists{/gist_id}","starred_url":"https://api.github.com/users/r3wt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r3wt/subscriptions","organizations_url":"https://api.github.com/users/r3wt/orgs","repos_url":"https://api.github.com/users/r3wt/repos","events_url":"https://api.github.com/users/r3wt/events{/privacy}","received_events_url":"https://api.github.com/users/r3wt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-31T14:25:18Z","updated_at":"2015-09-11T22:51:42Z","closed_at":"2015-09-11T18:44:48Z","body":"tables:\r\n\r\nartist\r\nmixtape\r\ntrack\r\n\r\nwhen creating a mixtape or track, script looks up to see if artist exists, if not it creates it and adds the inserted id as `artist_id` to mixtape/track model. this all works great, however redbean places overlapping constraints here, where no constraint is needed. either table should be able to reference an artist with `artist_id` but each table instead places its own constraint on the table."},"comment":{"url":"https://api.github.com/repos/gabordemooij/redbean/issues/comments/139680726","html_url":"https://github.com/gabordemooij/redbean/issues/465#issuecomment-139680726","issue_url":"https://api.github.com/repos/gabordemooij/redbean/issues/465","id":139680726,"user":{"login":"mrdamien","id":1787101,"avatar_url":"https://avatars.githubusercontent.com/u/1787101?v=3","gravatar_id":"","url":"https://api.github.com/users/mrdamien","html_url":"https://github.com/mrdamien","followers_url":"https://api.github.com/users/mrdamien/followers","following_url":"https://api.github.com/users/mrdamien/following{/other_user}","gists_url":"https://api.github.com/users/mrdamien/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdamien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdamien/subscriptions","organizations_url":"https://api.github.com/users/mrdamien/orgs","repos_url":"https://api.github.com/users/mrdamien/repos","events_url":"https://api.github.com/users/mrdamien/events{/privacy}","received_events_url":"https://api.github.com/users/mrdamien/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T22:51:42Z","updated_at":"2015-09-11T22:51:42Z","body":"Try casting $id to int - sounds like redbean is trying to change it to string?\r\n\r\n```\r\n$t->track_id = (int)$id;\r\n```"}}