mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
--not-null-default and not_null_default=, refs #24
This commit is contained in:
parent
7a3041b1ad
commit
2fed87da6e
7 changed files with 87 additions and 16 deletions
|
|
@ -284,6 +284,12 @@ You can explicitly specify the column you wish to reference using ``fk_col``:
|
|||
|
||||
db["dogs"].add_column("species_id", fk="species", fk_col="ref")
|
||||
|
||||
You can set a ``NOT NULL DEFAULT 'x'`` constraint on the new column using ``not_null_default``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
db["dogs"].add_column("friends_count", int, not_null_default=0)
|
||||
|
||||
.. _python_api_add_column_alter:
|
||||
|
||||
Adding columns automatically on insert/update
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue