{"html_url": "https://github.com/simonw/sqlite-utils/issues/16#issuecomment-496787958", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/16", "id": 496787958, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5Njc4Nzk1OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-29T05:17:58Z", "updated_at": "2019-05-29T05:17:58Z", "author_association": "OWNER", "body": "Shipped this feature in sqlite-utils 1.1: https://sqlite-utils.readthedocs.io/en/latest/changelog.html#v1-1", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 413867537, "label": "add_column() should support REFERENCES {other_table}({other_column})"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/16#issuecomment-496757010", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/16", "id": 496757010, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5Njc1NzAxMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-29T02:16:17Z", "updated_at": "2019-05-29T02:16:17Z", "author_association": "OWNER", "body": "In that case `--fk othertable` detects the primary key.\r\n\r\nIf you want to point at a different column, use `--fk-col X`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 413867537, "label": "add_column() should support REFERENCES {other_table}({other_column})"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/16#issuecomment-496756758", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/16", "id": 496756758, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5Njc1Njc1OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-29T02:14:50Z", "updated_at": "2019-05-29T02:14:50Z", "author_association": "OWNER", "body": "Hmm... probably not:\r\n\r\n> For options, only a fixed number of arguments is supported.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 413867537, "label": "add_column() should support REFERENCES {other_table}({other_column})"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/16#issuecomment-496756348", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/16", "id": 496756348, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5Njc1NjM0OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-29T02:12:43Z", "updated_at": "2019-05-29T02:12:43Z", "author_association": "OWNER", "body": "For the CLI I'm thinking:\r\n\r\n sqlite-utils add-column data.db mytable col text --fk othertable id\r\n\r\nSo the foreign key is added using `--fk othertable othercolumn`\r\n\r\nIf the user doesn't provide the column type we can derive it from the foreign key.\r\n\r\nCan we make the `othercolumn` optional? That would be neat - then we could automatically detect it using the sole primary key of the referenced table.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 413867537, "label": "add_column() should support REFERENCES {other_table}({other_column})"}, "performed_via_github_app": null}