Index: trunk/ippTools/share/magicdstool_todestreak_diff.sql
===================================================================
--- trunk/ippTools/share/magicdstool_todestreak_diff.sql	(revision 27476)
+++ trunk/ippTools/share/magicdstool_todestreak_diff.sql	(revision 27945)
@@ -10,4 +10,5 @@
     stage,
     magicRun.diff_id AS stage_id,
+    diffRun.magicked,
     diffSkyfile.skycell_id AS component,
     CAST(NULL AS CHAR(255)) AS uri,
@@ -47,13 +48,14 @@
     magicDSRun.label,
     rawExp.camera,
-    magicMask.uri as streaks_uri,
+    magicMask.uri AS streaks_uri,
     (SELECT uri from magicMask where magic_id = inv_magic_id) AS inv_streaks_uri,
     stage,
-    magicRun.diff_id as stage_id,
-    diffSkyfile.skycell_id as component,
+    magicRun.diff_id AS stage_id,
+    diffRun.magicked,
+    diffSkyfile.skycell_id AS component,
     CAST(NULL AS CHAR(255)) AS uri,
     diffSkyfile.path_base,
     magicRun.inverse,
-    CAST(NULL AS CHAR(255)) as cam_path_base,
+    CAST(NULL AS CHAR(255)) AS cam_path_base,
     CAST(NULL AS CHAR(255)) AS cam_reduction,
     outroot,
@@ -80,5 +82,5 @@
     AND diffSkyfile.quality = 0
     AND magicDSFile.component IS NULL
-) as magicDSRun
+) AS magicDSRun
 -- we need the following so this query is compatible with the other stages
 WHERE magic_ds_id IS NOT NULL
