persistent-migration-0.3.0: Manual migrations for the persistent library
MaintainerBrandon Chinn <brandonchinn178@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Database.Persist.Migration.Operation

Description

Defines the Operation data types.

Synopsis

Documentation

data Operation Source #

An operation that can be migrated.

Constructors

CreateTable 
DropTable 

Fields

RenameTable 

Fields

AddConstraint 
DropConstraint 

Fields

AddColumn 

Fields

RenameColumn 

Fields

DropColumn 
RawOperation

A custom operation that can be defined manually.

RawOperations should primarily use rawSql and rawExecute from the persistent library. If the operation depends on the backend being run, query connRDBMS from the SqlBackend:

asks connRDBMS >>= case
  "sqlite" -> ...
  _ -> return ()

Instances

Instances details
Show Operation Source # 
Instance details

Defined in Database.Persist.Migration.Operation

validateOperation :: Operation -> Either String () Source #

Validate that the given Operation is valid.

Orphan instances

Show (SqlPersistT m a) Source # 
Instance details

Methods

showsPrec :: Int -> SqlPersistT m a -> ShowS #

show :: SqlPersistT m a -> String #

showList :: [SqlPersistT m a] -> ShowS #