refurb-0.3.0.2: Tools for maintaining a database
Safe HaskellNone
LanguageHaskell2010

Refurb.Run.Migrate

Synopsis

Documentation

migrationPrefixDoc :: Migration -> Doc Source #

Helper which produces the standard prefix Doc for a given migration: migration key: with color.

migrate :: (MonadUnliftIO m, MonadRefurb m) => GoNoGo -> Maybe PreMigrationBackup -> InstallSeedData -> m () Source #

Implement the migrate command by verifying that seed data is only applied to non-production databases, reading the migration status, and determining from that status which migrations to apply. If the user requested execution of migrations, delegate to applyMigrations to actually do the work.

applyMigrations :: (MonadUnliftIO m, MonadRefurb m) => [Migration] -> m () Source #

Given a pre-vetted list of Migration structures to apply to the database, iterate through them and run their check actions (if any) followed by execution actions with log output captured.

locLogString :: Loc -> LogStr Source #

Format a Loc in the way we want for logging output - package:module filename:line:column

nowLogString :: IO LogStr Source #

Format the current timestamp in the way we want for logging output - yyyy-mm-dd hh:mm:ss.SSS