mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-05 17:04:10 +02:00
Add documentation for update_incoming_fks parameter
Document the new update_incoming_fks parameter in: - Python API docs (python-api.rst): New section explaining usage - CLI docs (cli.rst): Document --update-incoming-fks flag
This commit is contained in:
parent
798149b816
commit
0a567b7c50
2 changed files with 28 additions and 0 deletions
|
|
@ -2113,6 +2113,9 @@ Every option for this table (with the exception of ``--pk-none``) can be specifi
|
|||
``--add-foreign-key column other_table other_column``
|
||||
Add a foreign key constraint to ``column`` pointing to ``other_table.other_column``.
|
||||
|
||||
``--update-incoming-fks``
|
||||
When renaming columns, automatically update foreign key constraints in other tables that reference the renamed columns. For example, if ``books.author_id`` references ``authors.id`` and you rename ``authors.id`` to ``authors.author_pk``, this flag will also update the foreign key in ``books`` to reference the new column name.
|
||||
|
||||
If you want to see the SQL that will be executed to make the change without actually executing it, add the ``--sql`` flag. For example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue