Closed JBPressac closed 3 years ago
Hello, In the case when you want to import for instance: people.csv and coutry.csv where people.csv contains:
id, name, country_id 1, John, 1 2, Paul, 1 3, René, 2
and country.csv contains:
id, name 1, United Kingdom 2, France
Would it be possible to declare country_id as a foreign key of id in country.csv ? Thanks,
Looks like you can achieve this with sqlite-utils:
sqlite-utils add-foreign-key database.db People country_id Country id
Yes, sqlite-utils is the right tool for this.
sqlite-utils
Hello, In the case when you want to import for instance: people.csv and coutry.csv where people.csv contains:
id, name, country_id 1, John, 1 2, Paul, 1 3, René, 2
and country.csv contains:
id, name 1, United Kingdom 2, France
Would it be possible to declare country_id as a foreign key of id in country.csv ? Thanks,