summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/fixes/transactions_pkey_repost.sql7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/fixes/transactions_pkey_repost.sql b/sql/fixes/transactions_pkey_repost.sql
new file mode 100644
index 00000000..cc3935a6
--- /dev/null
+++ b/sql/fixes/transactions_pkey_repost.sql
@@ -0,0 +1,7 @@
+
+CREATE RULE ap_track_d AS ON DELETE TO ap DO ALSO DELETE FROM transactions
+WHERE id = old.id AND table_name = 'ap';
+CREATE RULE ar_track_d AS ON DELETE TO ar DO ALSO DELETE FROM transactions
+WHERE id = old.id AND table_name = 'ar';
+CREATE RULE gl_track_d AS ON DELETE TO ap DO ALSO DELETE FROM transactions
+WHERE id = old.id AND table_name = 'gl';