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
10 Ngrams by node enable contextual metrics.
14 {-# LANGUAGE QuasiQuotes #-}
16 module Gargantext.Database.Admin.Trigger.Init
19 import Data.Text (Text)
20 import Gargantext.Database.Admin.Trigger.ContextNodeNgrams (triggerCountInsert, triggerCountInsert2)
21 import Gargantext.Database.Admin.Trigger.Contexts (triggerSearchUpdate, triggerUpdateHash)
22 import Gargantext.Database.Admin.Trigger.NodesContexts ({-triggerDeleteCount,-} triggerInsertCount, triggerUpdateAdd, triggerUpdateDel, MasterListId) -- , triggerCoocInsert)
23 import Gargantext.Database.Prelude (Cmd)
24 import Gargantext.Prelude
26 ------------------------------------------------------------------------
27 initFirstTriggers :: Text -> Cmd err [Int64]
28 initFirstTriggers secret = do
29 t0 <- triggerUpdateHash secret
32 initLastTriggers :: MasterListId -> Cmd err [Int64]
33 initLastTriggers lId = do
34 t0 <- triggerSearchUpdate
35 t1 <- triggerCountInsert
36 t1' <- triggerCountInsert2
37 -- t1'' <- triggerCoocInsert lId
38 -- t2 <- triggerDeleteCount lId
39 t3 <- triggerInsertCount lId
40 t4 <- triggerUpdateAdd lId
41 t5 <- triggerUpdateDel lId