Skip to content

Commit

Permalink
Allow multiple --extra-migrations-folder arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
enobayram committed Jan 30, 2024
1 parent 6339a5a commit 78138b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions haskell-src/exec/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ runMigrations pool logg migAction migrations = do
baseFiles <- case migrationsFolderBase migrations of
Just migFolder -> getDir migFolder
Nothing -> return baseMigrationFiles
extraFiles <- case migrationsFolderExtra migrations of
Just migFolder -> getDir migFolder
Nothing -> return []
extraFiles <- flip foldMap (migrationsFolderExtra migrations) $
\migFolder -> getDir migFolder
let migrationFiles = baseFiles ++ extraFiles

let steps = map (uncurry Mg.MigrationStep) migrationFiles
Expand Down
4 changes: 2 additions & 2 deletions haskell-src/lib/ChainwebData/Env.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type MigrationsFolder = FilePath

data Migrations = Migrations
{ migrationsFolderBase :: Maybe MigrationsFolder
, migrationsFolderExtra :: Maybe MigrationsFolder
, migrationsFolderExtra :: [MigrationsFolder]
} deriving (Show)

data Args
Expand Down Expand Up @@ -278,7 +278,7 @@ migrationsParser = Migrations
<> metavar "PATH"
<> help "Path to the migrations folder"
)
<*> optional (strOption
<*> many (strOption
$ long "extra-migrations-folder"
<> metavar "PATH"
<> help "Path to extra migrations folder"
Expand Down

0 comments on commit 78138b1

Please sign in to comment.