mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
ignore/replace to create requires pk, refs #1927
This commit is contained in:
parent
272982e8a6
commit
6b27537988
2 changed files with 32 additions and 0 deletions
|
|
@ -605,6 +605,11 @@ class TableCreateView(BaseView):
|
|||
if not data.get("row") and not data.get("rows"):
|
||||
return _error(["ignore and replace require row or rows"])
|
||||
|
||||
# ignore and replace require pk or pks
|
||||
if "ignore" in data or "replace" in data:
|
||||
if not data.get("pk") and not data.get("pks"):
|
||||
return _error(["ignore and replace require pk or pks"])
|
||||
|
||||
ignore = data.get("ignore")
|
||||
replace = data.get("replace")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue