Added (normally defaulted) NULL
column constraint
This commit is contained in:
parent
8accc62cef
commit
bfa1b40b21
|
@ -1564,8 +1564,9 @@ TODO: change style
|
||||||
> colConstraintDef =
|
> colConstraintDef =
|
||||||
> ColConstraintDef
|
> ColConstraintDef
|
||||||
> <$> (optionMaybe (keyword_ "constraint" *> names))
|
> <$> (optionMaybe (keyword_ "constraint" *> names))
|
||||||
> <*> (notNull <|> unique <|> primaryKey <|> check <|> references)
|
> <*> (nullable <|> notNull <|> unique <|> primaryKey <|> check <|> references)
|
||||||
> where
|
> where
|
||||||
|
> nullable = ColNullableConstraint <$ keyword "null"
|
||||||
> notNull = ColNotNullConstraint <$ keywords_ ["not", "null"]
|
> notNull = ColNotNullConstraint <$ keywords_ ["not", "null"]
|
||||||
> unique = ColUniqueConstraint <$ keyword_ "unique"
|
> unique = ColUniqueConstraint <$ keyword_ "unique"
|
||||||
> primaryKey = ColPrimaryKeyConstraint <$ keywords_ ["primary", "key"]
|
> primaryKey = ColPrimaryKeyConstraint <$ keywords_ ["primary", "key"]
|
||||||
|
|
|
@ -571,7 +571,8 @@ I'm not sure if this is valid syntax or not.
|
||||||
> deriving (Eq,Show,Read,Data,Typeable)
|
> deriving (Eq,Show,Read,Data,Typeable)
|
||||||
|
|
||||||
> data ColConstraint =
|
> data ColConstraint =
|
||||||
> ColNotNullConstraint
|
> ColNullableConstraint
|
||||||
|
> | ColNotNullConstraint
|
||||||
> | ColUniqueConstraint
|
> | ColUniqueConstraint
|
||||||
> | ColPrimaryKeyConstraint
|
> | ColPrimaryKeyConstraint
|
||||||
> | ColReferencesConstraint [Name] (Maybe Name)
|
> | ColReferencesConstraint [Name] (Maybe Name)
|
||||||
|
|
Loading…
Reference in a new issue