dbmigrations-2.1.0: An implementation of relational database "migrations"
Safe HaskellNone
LanguageHaskell2010

Database.Schema.Migrations

Description

This module provides a high-level interface for the rest of this library.

Synopsis

Documentation

createNewMigration Source #

Arguments

:: MigrationStore

The MigrationStore in which to create a new migration

-> 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 [Text] 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.