File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,11 @@ createTriggerClosed :: Connection -> IO (Doc ann)
59
59
createTriggerClosed connection =
60
60
S. createWithQuery connection $
61
61
S. createTriggerAfterUpdate " set_closed_utc" " tasks"
62
- " (new.state is 'Done'\n \
62
+ " old.state is not new.state and (\n \
63
+ \new.state is 'Done'\n \
63
64
\or new.state is 'Obsolete'\n \
64
- \or new.state is 'Deletable')"
65
+ \or new.state is 'Deletable'\n \
66
+ \)"
65
67
" \
66
68
\update tasks\n \
67
69
\set closed_utc = datetime('now')\n \
Original file line number Diff line number Diff line change @@ -162,6 +162,20 @@ _3_ =
162
162
}
163
163
164
164
165
+ -- | Fixes activation condition of task closed trigger.
166
+ -- | FIXME: This empty migration is a hack to run an update of all triggers.
167
+ _4_ :: MigrateDirection -> Migration
168
+ _4_ =
169
+ let
170
+ base = Migration
171
+ { id = UserVersion 4
172
+ , querySet = []
173
+ }
174
+ in \ case
175
+ MigrateUp -> base { Migrations. querySet = [] }
176
+ MigrateDown -> base { Migrations. querySet = [] }
177
+
178
+
165
179
hasDuplicates :: Eq a => [a ] -> Bool
166
180
hasDuplicates [] = False
167
181
hasDuplicates (x: xs) =
@@ -221,6 +235,7 @@ runMigrations conf connection = do
221
235
_1_ :
222
236
_2_ :
223
237
_3_ :
238
+ _4_ :
224
239
[] )
225
240
226
241
migrationsUp = fmap ($ MigrateUp ) migrations
You can’t perform that action at this time.
0 commit comments