]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Admin/Trigger/Init.hs
[refactoring] add some default extensions to package.yaml
[gargantext.git] / src / Gargantext / Database / Admin / Trigger / Init.hs
1 {-|
2 Module : Gargantext.Database.Init
3 Description : Triggers configuration
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 Ngrams by node enable contextual metrics.
11
12 -}
13
14 {-# LANGUAGE QuasiQuotes #-}
15
16 module Gargantext.Database.Admin.Trigger.Init
17 where
18
19 import Gargantext.Database.Admin.Trigger.NodeNodeNgrams (triggerCountInsert, triggerCountInsert2)
20 import Gargantext.Database.Admin.Trigger.Nodes (triggerSearchUpdate)
21 import Gargantext.Database.Admin.Trigger.NodesNodes (triggerDeleteCount, triggerInsertCount, triggerUpdateAdd, triggerUpdateDel, MasterListId) -- , triggerCoocInsert)
22 import Gargantext.Database.Prelude (Cmd)
23 import Gargantext.Prelude
24
25 ------------------------------------------------------------------------
26
27 initTriggers :: MasterListId -> Cmd err [Int64]
28 initTriggers lId = do
29 t0 <- triggerSearchUpdate
30 t1 <- triggerCountInsert
31 t1' <- triggerCountInsert2
32 -- t1'' <- triggerCoocInsert lId
33 t2 <- triggerDeleteCount lId
34 t3 <- triggerInsertCount lId
35 t4 <- triggerUpdateAdd lId
36 t5 <- triggerUpdateDel lId
37 pure [t0
38 ,t1
39 ,t1'
40 -- ,t1''
41 ,t2
42 ,t3
43 ,t4
44 ,t5]
45
46