Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a high-level interface for the rest of this library.
- createNewMigration :: MigrationStore -> Migration -> IO (Either String Migration)
- ensureBootstrappedBackend :: Backend -> IO ()
- migrationsToApply :: StoreData -> Backend -> Migration -> IO [Migration]
- migrationsToRevert :: StoreData -> Backend -> Migration -> IO [Migration]
- missingMigrations :: Backend -> StoreData -> IO [String]
Documentation
:: MigrationStore | The |
-> Migration | The new migration |
-> IO (Either String Migration) |
Create a new migration and store it in the MigrationStore
.
ensureBootstrappedBackend :: Backend -> IO () Source
Given a Backend
, ensure that the backend is ready for use by
bootstrapping it. This entails installing the appropriate database
elements to track installed migrations. If the backend is already
bootstrapped, this has no effect.
migrationsToApply :: StoreData -> Backend -> Migration -> IO [Migration] Source
Given a migration mapping computed from a MigrationStore, a backend, and a migration to apply, return a list of migrations to apply, in order.
migrationsToRevert :: StoreData -> Backend -> Migration -> IO [Migration] Source
Given a migration mapping computed from a MigrationStore, a backend, and a migration to revert, return a list of migrations to revert, in order.
missingMigrations :: Backend -> StoreData -> IO [String] Source
Given a Backend
and a MigrationMap
, query the backend and
return a list of migration names which are available in the
MigrationMap
but which are not installed in the Backend
.