diff options
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r-- | archaeological_context_records/models.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 3fdc04f21..0a5ab7cbc 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -545,7 +545,7 @@ post_delete.connect(post_delete_record_relation, sender=RecordRelations) class RecordRelationView(models.Model): - """ + CREATE_SQL = """ CREATE VIEW record_relations AS SELECT DISTINCT right_record_id as id, right_record_id, @@ -557,6 +557,9 @@ class RecordRelationView(models.Model): CREATE RULE record_relations_del AS ON DELETE TO record_relations DO INSTEAD DELETE FROM record_relations where id=NULL; """ + DELETE_SQL = """ + DROP VIEW record_relations; + """ TABLE_COLS = [ "relation_type", "right_record__label", "right_record__unit", "right_record__parcel", |