You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add_column() should support REFERENCES {other_table}({other_column}) #16
Activity
simonw commentedon May 29, 2019
For the CLI I'm thinking:
So the foreign key is added using
--fk othertable othercolumnIf the user doesn't provide the column type we can derive it from the foreign key.
Can we make the
othercolumnoptional? That would be neat - then we could automatically detect it using the sole primary key of the referenced table.simonw commentedon May 29, 2019
Hmm... probably not:
simonw commentedon May 29, 2019
In that case
--fk othertabledetects the primary key.If you want to point at a different column, use
--fk-col Xsimonw commentedon May 29, 2019
Shipped this feature in sqlite-utils 1.1: https://sqlite-utils.readthedocs.io/en/latest/changelog.html#v1-1