Database.Schema.Migrations
Description
This module provides a high-level interface for the rest of this library.
- createNewMigration :: (MonadMigration m, MigrationStore s m) => s -> String -> [String] -> m (Either String Migration)
- ensureBootstrappedBackend :: Backend b m => b -> m ()
- migrationsToApply :: Backend b m => StoreData -> b -> Migration -> m [Migration]
- migrationsToRevert :: Backend b m => StoreData -> b -> Migration -> m [Migration]
- missingMigrations :: Backend b m => b -> StoreData -> m [String]
Documentation
Arguments
:: (MonadMigration m, MigrationStore s m) | |
=> s | The |
-> String | The name of the new migration to create |
-> [String] | The list of migration names on which the new migration should depend |
-> m (Either String Migration) |
Create a new migration and store it in the MigrationStore
,
with some of its fields initially set to defaults.
ensureBootstrappedBackend :: Backend b m => b -> m ()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 :: Backend b m => StoreData -> b -> Migration -> m [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 :: Backend b m => StoreData -> b -> Migration -> m [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 b m => b -> StoreData -> m [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
.