persistent-migration-0.1.0: Manual migrations for the persistent library

MaintainerBrandon Chinn <brandonchinn178@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Database.Persist.Migration.Operation.Types

Contents

Description

Defines auxiliary data types that can be used in Operations.

Synopsis

Documentation

type ColumnIdentifier = (Text, Text) Source #

A column identifier, table.column

dotted :: ColumnIdentifier -> Text Source #

Make a ColumnIdentifier displayable.

data Column Source #

The definition for a Column in a SQL database.

Constructors

Column 
Instances
Show Column Source # 
Instance details

Defined in Database.Persist.Migration.Operation.Types

validateColumn :: Column -> Either String () Source #

Validate a Column.

data ColumnProp Source #

A property for a Column.

Constructors

NotNull

Makes a column non-nullable (defaults to nullable)

References ColumnIdentifier

Mark this column as a foreign key to the given column

AutoIncrement

Makes a column auto-incrementing

Default PersistValue

Sets the default value for the column. Note that this doesn't matter when inserting data via Haskell; this property only sets the schema in the SQL backend.

See AddColumn for setting the default value for existing rows in a migration.

More info: https://www.yesodweb.com/book/persistent#persistent_attributes

Instances
Eq ColumnProp Source # 
Instance details

Defined in Database.Persist.Migration.Operation.Types

Data ColumnProp Source # 
Instance details

Defined in Database.Persist.Migration.Operation.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ColumnProp -> c ColumnProp #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ColumnProp #

toConstr :: ColumnProp -> Constr #

dataTypeOf :: ColumnProp -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ColumnProp) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColumnProp) #

gmapT :: (forall b. Data b => b -> b) -> ColumnProp -> ColumnProp #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ColumnProp -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ColumnProp -> r #

gmapQ :: (forall d. Data d => d -> u) -> ColumnProp -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ColumnProp -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ColumnProp -> m ColumnProp #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ColumnProp -> m ColumnProp #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ColumnProp -> m ColumnProp #

Show ColumnProp Source # 
Instance details

Defined in Database.Persist.Migration.Operation.Types

data TableConstraint Source #

Table constraints in a CREATE query.

Constructors

PrimaryKey [Text]

PRIMARY KEY (col1, col2, ...)

Unique Text [Text]

CONSTRAINT name UNIQUE (col1, col2, ...)

Instances
Data TableConstraint Source # 
Instance details

Defined in Database.Persist.Migration.Operation.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TableConstraint -> c TableConstraint #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TableConstraint #

toConstr :: TableConstraint -> Constr #

dataTypeOf :: TableConstraint -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TableConstraint) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableConstraint) #

gmapT :: (forall b. Data b => b -> b) -> TableConstraint -> TableConstraint #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TableConstraint -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TableConstraint -> r #

gmapQ :: (forall d. Data d => d -> u) -> TableConstraint -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TableConstraint -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TableConstraint -> m TableConstraint #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TableConstraint -> m TableConstraint #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TableConstraint -> m TableConstraint #

Show TableConstraint Source # 
Instance details

Defined in Database.Persist.Migration.Operation.Types

getConstraintColumns :: TableConstraint -> [Text] Source #

Get the columns defined in the given TableConstraint.

Orphan instances

Data PersistValue Source # 
Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PersistValue -> c PersistValue #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PersistValue #

toConstr :: PersistValue -> Constr #

dataTypeOf :: PersistValue -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PersistValue) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PersistValue) #

gmapT :: (forall b. Data b => b -> b) -> PersistValue -> PersistValue #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PersistValue -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PersistValue -> r #

gmapQ :: (forall d. Data d => d -> u) -> PersistValue -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PersistValue -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PersistValue -> m PersistValue #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PersistValue -> m PersistValue #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PersistValue -> m PersistValue #