diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-06-03 13:32:20 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:20 +0100 |
commit | 006a33f7be51d968aef0795cdf4f6f4fd1e5ba2f (patch) | |
tree | 278ddd2d2de7b3c95f1d9d932c785f9397172b81 /archaeological_warehouse/models.py | |
parent | 25e62472339c75b8672a5390f2dc8f098f736f1e (diff) | |
download | Ishtar-006a33f7be51d968aef0795cdf4f6f4fd1e5ba2f.tar.bz2 Ishtar-006a33f7be51d968aef0795cdf4f6f4fd1e5ba2f.zip |
Container trees: INSERT rules
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 2df5cbe77..5cadc46da 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -460,10 +460,20 @@ class ContainerTree(models.Model): DO INSTEAD DELETE FROM archaeological_warehouse_container where id=NULL; CREATE RULE containers_tree_update AS ON UPDATE TO containers_tree - DO INSTEAD UPDATE archaeological_warehouse_container set id=id WHERE id=NULL; + DO INSTEAD UPDATE archaeological_warehouse_container set id=id + WHERE id=NULL; CREATE RULE container_tree_update AS ON UPDATE TO container_tree - DO INSTEAD UPDATE archaeological_warehouse_container set id=id WHERE id=NULL; + DO INSTEAD UPDATE archaeological_warehouse_container set id=id + WHERE id=NULL; + CREATE RULE containers_tree_insert AS + ON INSERT TO containers_tree + DO INSTEAD UPDATE archaeological_warehouse_container set id=id + WHERE id=NULL; + CREATE RULE container_tree_insert AS + ON INSERT TO container_tree + DO INSTEAD UPDATE archaeological_warehouse_container set id=id + WHERE id=NULL; """ DELETE_SQL = """ DROP VIEW IF EXISTS container_tree; |