summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-09-16 23:24:34 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-09-16 23:24:34 +0200
commit70eb55ced51a74353cabc0389156f0da4ddf9621 (patch)
tree40270a35521867b4bb06fb128cf47b6c47baa66e /archaeological_finds
parent49e07525f03cf79fafe8d57e4fad7c89642eb3ac (diff)
downloadIshtar-70eb55ced51a74353cabc0389156f0da4ddf9621.tar.bz2
Ishtar-70eb55ced51a74353cabc0389156f0da4ddf9621.zip
Add 'IF EXISTS' to 'DROP VIEW' statement in migrations
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/models_treatments.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index 89364f0fe..85d1cb0d0 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -710,8 +710,8 @@ class FindNonModifTreatments(AbsFindTreatments):
DO INSTEAD DELETE FROM archaeological_finds_find where id=NULL;
"""
DELETE_SQL = """
- DROP VIEW find_nonmodif_treatments;
- DROP VIEW find_nonmodif_treatments_tree;
+ DROP VIEW IF EXISTS find_nonmodif_treatments;
+ DROP VIEW IF EXISTS find_nonmodif_treatments_tree;
"""
TABLE_COLS = ['treatment__treatment_type',
'treatment__upstream',
@@ -767,8 +767,8 @@ class FindUpstreamTreatments(AbsFindTreatments):
DO INSTEAD DELETE FROM archaeological_finds_find where id=NULL;
"""
DELETE_SQL = """
- DROP VIEW find_uptreatments;
- DROP VIEW find_uptreatments_tree;
+ DROP VIEW IF EXISTS find_uptreatments;
+ DROP VIEW IF EXISTS find_uptreatments_tree;
"""
TABLE_COLS = ['treatment__treatment_type',
'treatment__upstream',
@@ -824,8 +824,8 @@ class FindDownstreamTreatments(AbsFindTreatments):
DO INSTEAD DELETE FROM archaeological_finds_find where id=NULL;
"""
DELETE_SQL = """
- DROP VIEW find_downtreatments;
- DROP VIEW find_downtreatments_tree;
+ DROP VIEW IF EXISTS find_downtreatments;
+ DROP VIEW IF EXISTS find_downtreatments_tree;
"""
TABLE_COLS = ['treatment__treatment_type',
'treatment__downstream',
@@ -858,7 +858,7 @@ class FindTreatments(AbsFindTreatments):
DO INSTEAD DELETE FROM archaeological_finds_find where id=NULL;
"""
DELETE_SQL = """
- DROP VIEW find_treatments;
+ DROP VIEW IF EXISTS find_treatments;
"""
upstream = models.BooleanField(_(u"Is upstream"))