[chronojump] At export ensure encoder trigger from unwanted sessions is deleted



commit baa19a9e84b51cad0a8b8b75bf898190913536ef
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Sep 3 11:09:57 2020 +0200

    At export ensure encoder trigger from unwanted sessions is deleted

 src/sqlite/session.cs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/sqlite/session.cs b/src/sqlite/session.cs
index cf4b0d4d..a2a6825f 100644
--- a/src/sqlite/session.cs
+++ b/src/sqlite/session.cs
@@ -983,7 +983,7 @@ class SqliteSession : Sqlite
                        reader = dbcmd.ExecuteReader();
                        List<string> signal_l = new List<string>();
 
-                       // 2 delete all the EncoderSignalCurves (relation with signal and curves) of that 
signals
+                       // 2 delete all the EncoderSignalCurves (relation with signal and curves) of that 
signals, and also triggers
                        while(reader.Read())
                                signal_l.Add(reader[0].ToString());
 
@@ -994,6 +994,9 @@ class SqliteSession : Sqlite
                                dbcmd.CommandText = "Delete FROM " + Constants.EncoderSignalCurveTable +
                                        " WHERE signalID = " + signal;
                                dbcmd.ExecuteNonQuery();
+
+                               // delete related triggers
+                               SqliteTrigger.DeleteByModeID(true, Convert.ToInt32(signal));
                        }
 
                        // 3 delete all encoder table stuff (signals and curves)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]