Commit 9a29b3fc authored by Alexandre Delanoë's avatar Alexandre Delanoë

[BIN] upgrade script

parent 516ca84e
Pipeline #1737 passed with stage
in 34 minutes and 43 seconds
...@@ -19,33 +19,37 @@ import Gargantext.API.Admin.EnvTypes (DevEnv) ...@@ -19,33 +19,37 @@ import Gargantext.API.Admin.EnvTypes (DevEnv)
import Gargantext.API.Dev (withDevEnv, runCmdDev) import Gargantext.API.Dev (withDevEnv, runCmdDev)
import Gargantext.API.Prelude (GargError) import Gargantext.API.Prelude (GargError)
import Gargantext.API.Node () -- instances only import Gargantext.API.Node () -- instances only
import Gargantext.API.Ngrams.Tools (getRepo)
import Gargantext.Database.Prelude (Cmd'', ) import Gargantext.Database.Prelude (Cmd'', )
import Gargantext.Core.NodeStory
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Prelude.Config (GargConfig(..), readConfig)
import System.Environment (getArgs) import System.Environment (getArgs)
import Prelude (getLine) import Prelude (getLine)
import GHC.IO.Exception (IOException)
-- PosTag
import Gargantext.Database.Action.Flow (indexAllDocumentsWithPosTag)
main :: IO () main :: IO ()
main = do main = do
[iniPath] <- getArgs
putStrLn "Manual method (for now):" putStrLn "Manual method:"
putStrLn "Upgrade your schema database with the script:" putStrLn "Upgrade your GarganText instance with the script:"
putStrLn "psql gargandbV5 < ./devops/postgres/upgrade/0.0.2.6.sql" putStrLn "Then press enter key to launch upgrade."
putStrLn "Then press enter key when you are done"
_ok <- getLine _ok <- getLine
[iniPath] <- getArgs
cfg <- readConfig iniPath
let let
upgrade :: Cmd'' DevEnv GargError () -- upgrade :: Cmd'' DevEnv GargError ()
upgrade :: Cmd'' DevEnv IOException ()
upgrade = do upgrade = do
-- This method does not work for now let repo_filepath = _gc_repofilepath cfg
-- _ <- createTable_NgramsPostag repo <- getRepo
_ <- indexAllDocumentsWithPosTag _ <- liftBase $ repoMigration repo_filepath repo
pure () pure ()
withDevEnv iniPath $ \env -> do withDevEnv iniPath $ \env -> do
_ <- runCmdDev env upgrade _ <- runCmdDev env upgrade
putStrLn "Uprade" putStrLn "Uprade done with success"
pure () pure ()
...@@ -43,12 +43,14 @@ library: ...@@ -43,12 +43,14 @@ library:
- Gargantext.API.Node - Gargantext.API.Node
- Gargantext.API.Node.File - Gargantext.API.Node.File
- Gargantext.API.Ngrams - Gargantext.API.Ngrams
- Gargantext.API.Ngrams.Tools
- Gargantext.API.Ngrams.Types - Gargantext.API.Ngrams.Types
- Gargantext.API.Admin.Settings - Gargantext.API.Admin.Settings
- Gargantext.API.Admin.EnvTypes - Gargantext.API.Admin.EnvTypes
- Gargantext.API.Admin.Types - Gargantext.API.Admin.Types
- Gargantext.API.Prelude - Gargantext.API.Prelude
- Gargantext.Core - Gargantext.Core
- Gargantext.Core.NodeStory
- Gargantext.Core.Methods.Distances - Gargantext.Core.Methods.Distances
- Gargantext.Core.Types - Gargantext.Core.Types
- Gargantext.Core.Types.Individu - Gargantext.Core.Types.Individu
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment