Browse Source

Fixed a bug in which placeholder next ids in the note_current table weren't getting reaped.

Dan Helfman 9 years ago
parent
commit
a580e1759d
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      model/reap.sql

+ 9
- 0
model/reap.sql View File

@@ -64,6 +64,15 @@ where
64 64
       note_current.revision < now() - interval '1 day'
65 65
   );
66 66
 
67
+delete from
68
+  note_current
69
+where (
70
+  notebook_id is null or notebook_id not in
71
+    ( select notebook_id from notebook_current )
72
+)
73
+and
74
+  note_current.revision < now() - interval '1 day';
75
+
67 76
 -- Delete unused file next ids and files whose notebooks or notes no longer exist.
68 77
 delete from
69 78
   file

Loading…
Cancel
Save