mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-26 19:04:32 +02:00
not_null support for .create(transform=True), refs #467
This commit is contained in:
parent
9e3d8abc58
commit
341f000097
2 changed files with 14 additions and 2 deletions
|
|
@ -929,6 +929,11 @@ class Database:
|
|||
desired_pk = list(pk)
|
||||
if desired_pk and current_pks != desired_pk:
|
||||
needs_transform = True
|
||||
# Any not-null changes?
|
||||
current_not_null = {c.name for c in table.columns if c.notnull}
|
||||
desired_not_null = set(not_null) if not_null else set()
|
||||
if current_not_null != desired_not_null:
|
||||
needs_transform = True
|
||||
# Only run .transform() if there is something to do
|
||||
# TODO: what about not null and defaults?
|
||||
if needs_transform:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue