]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Admin/Trigger/Init.hs
[SECURITY] password check implemented (needs tests).
[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 FlexibleContexts #-}
15 {-# LANGUAGE QuasiQuotes #-}
16 {-# LANGUAGE NoImplicitPrelude #-}
17 {-# LANGUAGE OverloadedStrings #-}
18 {-# LANGUAGE RankNTypes #-}
19
20 module Gargantext.Database.Admin.Trigger.Init
21 where
22
23 import Gargantext.Database.Admin.Trigger.NodeNodeNgrams (triggerCountInsert, triggerCountInsert2)
24 import Gargantext.Database.Admin.Trigger.Nodes (triggerSearchUpdate)
25 import Gargantext.Database.Admin.Trigger.NodesNodes (triggerDeleteCount, triggerInsertCount, triggerUpdateAdd, triggerUpdateDel, MasterListId) -- , triggerCoocInsert)
26 import Gargantext.Database.Prelude (Cmd)
27 import Gargantext.Prelude
28
29 ------------------------------------------------------------------------
30
31 initTriggers :: MasterListId -> Cmd err [Int64]
32 initTriggers lId = do
33 t0 <- triggerSearchUpdate
34 t1 <- triggerCountInsert
35 t1' <- triggerCountInsert2
36 -- t1'' <- triggerCoocInsert lId
37 t2 <- triggerDeleteCount lId
38 t3 <- triggerInsertCount lId
39 t4 <- triggerUpdateAdd lId
40 t5 <- triggerUpdateDel lId
41 pure [t0
42 ,t1
43 ,t1'
44 -- ,t1''
45 ,t2
46 ,t3
47 ,t4
48 ,t5]
49
50