relocant-1.0.0: A PostgreSQL migration CLI tool and library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Relocant.Applied

Description

This module deals with applied migrations and their records in the DB.

Synopsis

Documentation

data Applied Source #

An applied migration. Generally, it's created be either running a migration Script with apply or getting the records from the DB with getApplied or getAppliedByID.

Constructors

Applied 

Fields

Instances

Instances details
ToJSON Applied Source #

The content (as in actual bytes) is skipped.

Instance details

Defined in Relocant.Applied

Show Applied Source # 
Instance details

Defined in Relocant.Applied

Eq Applied Source # 
Instance details

Defined in Relocant.Applied

Methods

(==) :: Applied -> Applied -> Bool #

(/=) :: Applied -> Applied -> Bool #

HasField "bytes" Applied ByteString Source # 
Instance details

Defined in Relocant.Applied

getApplied :: Table -> Connection -> IO [Applied] Source #

Retrieve all Applied migrations' records from the DB.

getAppliedByID :: ID -> Table -> Connection -> IO (Maybe Applied) Source #

Retrieve the specific Applied migration's record from the DB.

record :: Applied -> Table -> Connection -> IO () Source #

Record a successfully Applied migration.

Note: You probably want to run this together with apply in a single transaction.

deleteAll :: Table -> Connection -> IO () Source #

Delete all Applied migrations' records from the DB.

deleteByID :: ID -> Table -> Connection -> IO Bool Source #

Delete the specific Applied migration's record from the DB.