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.NodeNodeNgrams
22 import Gargantext.Database.Schema.Prelude
23 import Gargantext.Database.Schema.Ngrams (NgramsTypeId, NgramsId)
24 import Gargantext.Database.Admin.Types.Node
26 data NodeNodeNgramsPoly n1 n2 ngrams_id ngt w
27 = NodeNodeNgrams { _nnng_node1_id :: !n1
28 , _nnng_node2_id :: !n2
29 , _nnng_ngrams_id :: !ngrams_id
30 , _nnng_ngramsType :: !ngt
34 type NodeNodeNgramsWrite =
35 NodeNodeNgramsPoly (Column SqlInt4 )
41 type NodeNodeNgramsRead =
42 NodeNodeNgramsPoly (Column SqlInt4 )
48 type NodeNodeNgramsReadNull =
49 NodeNodeNgramsPoly (Column (Nullable SqlInt4 ))
50 (Column (Nullable SqlInt4 ))
51 (Column (Nullable SqlInt4 ))
52 (Column (Nullable SqlInt4 ))
53 (Column (Nullable SqlFloat8))
56 NodeNodeNgramsPoly CorpusId DocId NgramsId NgramsTypeId Double
58 $(makeAdaptorAndInstance "pNodeNodeNgrams" ''NodeNodeNgramsPoly)
59 makeLenses ''NodeNodeNgramsPoly
62 nodeNodeNgramsTable :: Table NodeNodeNgramsWrite NodeNodeNgramsRead
63 nodeNodeNgramsTable = Table "node_node_ngrams"
64 ( pNodeNodeNgrams NodeNodeNgrams
65 { _nnng_node1_id = requiredTableField "node1_id"
66 , _nnng_node2_id = requiredTableField "node2_id"
67 , _nnng_ngrams_id = requiredTableField "ngrams_id"
68 , _nnng_ngramsType = requiredTableField "ngrams_type"
69 , _nnng_weight = requiredTableField "weight"