]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Schema/ContextNodeNgrams2.hs
[WIP] backup during the vacations
[gargantext.git] / src / Gargantext / Database / Schema / ContextNodeNgrams2.hs
1 {-|
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
8 Portability : POSIX
9
10 -}
11
12 {-# OPTIONS_GHC -fno-warn-orphans #-}
13
14 {-# LANGUAGE Arrows #-}
15 {-# LANGUAGE FunctionalDependencies #-}
16 {-# LANGUAGE TemplateHaskell #-}
17
18 module Gargantext.Database.Schema.ContextNodeNgrams2
19 where
20
21 import Gargantext.Database.Admin.Types.Node
22 import Gargantext.Database.Schema.NodeNgrams (NodeNgramsId)
23 import Gargantext.Database.Schema.Prelude
24 import Prelude
25
26
27 type ContextNodeNgrams2 =
28 ContextNodeNgrams2Poly ContextId NodeNgramsId Weight
29
30 type Weight = Double
31
32 data ContextNodeNgrams2Poly context_id nodengrams_id w
33 = ContextNodeNgrams2 { _cnng2_context_id :: !context_id
34 , _cnng2_nodengrams_id :: !nodengrams_id
35 , _cnng2_weight :: !w
36 } deriving (Show)
37
38 type ContextNodeNgrams2Write =
39 ContextNodeNgrams2Poly (Column SqlInt4 )
40 (Column SqlInt4 )
41 (Column SqlFloat8)
42
43 type ContextNodeNgrams2Read =
44 ContextNodeNgrams2Poly (Column SqlInt4 )
45 (Column SqlInt4 )
46 (Column SqlFloat8)
47
48 type ContextNodeNgrams2ReadNull =
49 ContextNodeNgrams2Poly (Column (Nullable SqlInt4 ))
50 (Column (Nullable SqlInt4 ))
51 (Column (Nullable SqlFloat8))
52
53 $(makeAdaptorAndInstance "pContextNodeNgrams2" ''ContextNodeNgrams2Poly)
54 makeLenses ''ContextNodeNgrams2Poly
55
56 contextNodeNgrams2Table :: Table ContextNodeNgrams2Write ContextNodeNgrams2Read
57 contextNodeNgrams2Table = Table "context_node_ngrams2"
58 ( pContextNodeNgrams2 ContextNodeNgrams2
59 { _cnng2_context_id = requiredTableField "context_id"
60 , _cnng2_nodengrams_id = requiredTableField "nodengrams_id"
61 , _cnng2_weight = requiredTableField "weight"
62 }
63 )