| Maintainer | Brandon Chinn <brandonchinn178@gmail.com> |
|---|---|
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Database.Persist.Migration.Operation
Contents
Description
Defines the Operation data types.
Synopsis
- data Operation
- = CreateTable {
- name :: Text
- schema :: [Column]
- constraints :: [TableConstraint]
- | DropTable { }
- | RenameTable { }
- | AddConstraint { }
- | DropConstraint {
- table :: Text
- constraintName :: Text
- | AddColumn {
- table :: Text
- column :: Column
- colDefault :: Maybe PersistValue
- | RenameColumn { }
- | DropColumn { }
- | RawOperation {
- message :: Text
- rawOp :: SqlPersistT IO [MigrateSql]
- = CreateTable {
- validateOperation :: Operation -> Either String ()
Documentation
An operation that can be migrated.
Constructors
| CreateTable | |
Fields
| |
| DropTable | |
| RenameTable | |
| AddConstraint | |
Fields
| |
| DropConstraint | |
Fields
| |
| AddColumn | |
Fields
| |
| RenameColumn | |
| DropColumn | |
Fields | |
| RawOperation | A custom operation that can be defined manually. RawOperations should primarily use asks connRDBMS >>= case "sqlite" -> ... _ -> return () |
Fields
| |
validateOperation :: Operation -> Either String () Source #
Validate that the given Operation is valid.
Orphan instances
| Show (SqlPersistT m a) Source # | |
Methods showsPrec :: Int -> SqlPersistT m a -> ShowS # show :: SqlPersistT m a -> String # showList :: [SqlPersistT m a] -> ShowS # | |