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.Types

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

Instances details
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

data TableConstraint Source #

Table constraints in a CREATE query.

Constructors

PrimaryKey [Text]

PRIMARY KEY (col1, col2, ...)

Unique Text [Text]

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

getConstraintColumns :: TableConstraint -> [Text] Source #

Get the columns defined in the given TableConstraint.