home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 349850687

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association pull_request body repo type active_lock_reason performed_via_github_app reactions draft state_reason
349850687 MDU6SXNzdWUzNDk4NTA2ODc= 2 Mechanism for adding foreign keys to an existing table 9599 closed 0     1 2018-08-12T22:50:56Z 2019-02-24T21:34:41Z 2019-02-24T21:34:41Z OWNER  

SQLite does not have ALTER TABLE support for adding new foreign keys... but it turns out it's possible to make these changes without having to duplicate the entire table by carefully running UPDATE sqlite_master SET sql=... WHERE type='table' AND name='X';

Here's how Django does it: https://github.com/django/django/blob/d3449faaa915a08c275b35de01e66a7ef6bdb2dc/django/db/backends/sqlite3/schema.py#L103-L125

And here's the official documentation about this: https://sqlite.org/lang_altertable.html#otheralter (scroll to the very bottom of the page)

140912432 issue    
{
    "url": "https://api.github.com/repos/simonw/sqlite-utils/issues/2/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.924ms · About: github-to-sqlite