2 Module : Gargantext.Database.Schema.NodeNodeNgrams
3 Description : TODO: remove this module and table in database
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
12 {-# OPTIONS_GHC -fno-warn-orphans #-}
14 {-# LANGUAGE Arrows #-}
15 {-# LANGUAGE FunctionalDependencies #-}
16 {-# LANGUAGE TemplateHaskell #-}
18 module Gargantext.Database.Schema.ContextNodeNgrams
22 import Gargantext.Database.Schema.Prelude
23 import Gargantext.Database.Schema.Ngrams (NgramsTypeId, NgramsId)
24 import Gargantext.Database.Admin.Types.Node
28 type ContextNodeNgrams =
29 ContextNodeNgramsPoly ContextId ListId NgramsId NgramsTypeId Double
32 data ContextNodeNgramsPoly c n ngrams_id ngt w
33 = ContextNodeNgrams { _cnng_context_id :: !c
35 , _cnng_ngrams_id :: !ngrams_id
36 , _cnng_ngramsType :: !ngt
40 type ContextNodeNgramsWrite =
41 ContextNodeNgramsPoly (Column SqlInt4 )
47 type ContextNodeNgramsRead =
48 ContextNodeNgramsPoly (Column SqlInt4 )
54 type ContextNodeNgramsReadNull =
55 ContextNodeNgramsPoly (Column (Nullable SqlInt4 ))
56 (Column (Nullable SqlInt4 ))
57 (Column (Nullable SqlInt4 ))
58 (Column (Nullable SqlInt4 ))
59 (Column (Nullable SqlFloat8))
61 $(makeAdaptorAndInstance "pContextNodeNgrams" ''ContextNodeNgramsPoly)
62 makeLenses ''ContextNodeNgramsPoly
65 contextNodeNgramsTable :: Table ContextNodeNgramsWrite ContextNodeNgramsRead
66 contextNodeNgramsTable = Table "context_node_ngrams"
67 ( pContextNodeNgrams ContextNodeNgrams
68 { _cnng_context_id = requiredTableField "context_id"
69 , _cnng_node_id = requiredTableField "node_id"
70 , _cnng_ngrams_id = requiredTableField "ngrams_id"
71 , _cnng_ngramsType = requiredTableField "ngrams_type"
72 , _cnng_weight = requiredTableField "weight"