]> Git — Sourcephile - gargantext.git/blob - bin/gargantext-upgrade/Main.hs
merge done
[gargantext.git] / bin / gargantext-upgrade / Main.hs
1 {-|
2 Module : Main.hs
3 Description : Gargantext Import Corpus
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 Import a corpus binary.
11
12 -}
13
14 {-# LANGUAGE Strict #-}
15
16 module Main where
17
18 import Gargantext.API.Admin.EnvTypes (DevEnv)
19 import Gargantext.API.Dev (withDevEnv, runCmdDev)
20 import Gargantext.API.Prelude (GargError)
21 import Gargantext.API.Node () -- instances only
22 import Gargantext.Database.Prelude (Cmd'', )
23 import Gargantext.Prelude
24 import System.Environment (getArgs)
25 import Prelude (getLine)
26
27 -- | PosTag
28 import Gargantext.Database.Action.Flow (indexAllDocumentsWithPosTag)
29
30 main :: IO ()
31 main = do
32 [iniPath] <- getArgs
33
34 putStrLn "Manual method (for now):"
35 putStrLn "Upgrade your schema database with the script:"
36 putStrLn "psql gargandbV5 < ./devops/postgres/upgrade/0.0.2.6.sql"
37 putStrLn "Then press enter key when you are done"
38 _ok <- getLine
39
40 let
41 upgrade :: Cmd'' DevEnv GargError ()
42 upgrade = do
43 -- This method does not work for now
44 -- _ <- createTable_NgramsPostag
45 _ <- indexAllDocumentsWithPosTag
46 pure ()
47
48 withDevEnv iniPath $ \env -> do
49 _ <- runCmdDev env upgrade
50 putStrLn "Uprade"
51 pure ()