mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
table.m2m(..., alter=True) option, closes #222
This commit is contained in:
parent
0b244d207a
commit
d4e00f8d01
3 changed files with 24 additions and 1 deletions
|
|
@ -716,6 +716,8 @@ If it cannot find such a table, it will create a new one using the names of the
|
|||
|
||||
It it finds multiple candidate tables with foreign keys to both of the specified tables it will raise a ``sqlite_utils.db.NoObviousTable`` exception. You can avoid this error by specifying the correct table using ``m2m_table=``.
|
||||
|
||||
The ``.m2m()`` method also takes an optional ``pk=`` argument to specify the primary key that should be used if the table is created, and an optional ``alter=True`` argument to specify that any missing columns of an existing table should be added if they are needed.
|
||||
|
||||
.. _python_api_m2m_lookup:
|
||||
|
||||
Using m2m and lookup tables together
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue