mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
parent
0fe3b38290
commit
e8f887ef4a
6 changed files with 64 additions and 0 deletions
|
|
@ -419,6 +419,17 @@ Here's an example adding two foreign keys at once:
|
|||
("dogs", "home_town_id", "towns", "id")
|
||||
])
|
||||
|
||||
.. _python_api_index_foreign_keys:
|
||||
|
||||
Adding indexes for all foreign keys
|
||||
-----------------------------------
|
||||
|
||||
If you want to ensure that every foreign key column in your database has a corresponding index, you can do so like this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
db.index_foreign_keys()
|
||||
|
||||
.. _python_api_hash:
|
||||
|
||||
Setting an ID based on the hash of the row contents
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue