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 PGInt4 )
41 type NodeNodeNgramsRead =
42 NodeNodeNgramsPoly (Column PGInt4 )
48 type NodeNodeNgramsReadNull =
49 NodeNodeNgramsPoly (Column (Nullable PGInt4 ))
50 (Column (Nullable PGInt4 ))
51 (Column (Nullable PGInt4 ))
52 (Column (Nullable PGInt4 ))
53 (Column (Nullable PGFloat8))
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 = required "node1_id"
66 , _nnng_node2_id = required "node2_id"
67 , _nnng_ngrams_id = required "ngrams_id"
68 , _nnng_ngramsType = required "ngrams_type"
69 , _nnng_weight = required "weight"