Added (normally defaulted) NULL
column constraint
This commit is contained in:
parent
8accc62cef
commit
bfa1b40b21
|
@ -1564,8 +1564,9 @@ TODO: change style
|
|||
> colConstraintDef =
|
||||
> ColConstraintDef
|
||||
> <$> (optionMaybe (keyword_ "constraint" *> names))
|
||||
> <*> (notNull <|> unique <|> primaryKey <|> check <|> references)
|
||||
> <*> (nullable <|> notNull <|> unique <|> primaryKey <|> check <|> references)
|
||||
> where
|
||||
> nullable = ColNullableConstraint <$ keyword "null"
|
||||
> notNull = ColNotNullConstraint <$ keywords_ ["not", "null"]
|
||||
> unique = ColUniqueConstraint <$ keyword_ "unique"
|
||||
> 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)
|
||||
|
||||
> data ColConstraint =
|
||||
> ColNotNullConstraint
|
||||
> ColNullableConstraint
|
||||
> | ColNotNullConstraint
|
||||
> | ColUniqueConstraint
|
||||
> | ColPrimaryKeyConstraint
|
||||
> | ColReferencesConstraint [Name] (Maybe Name)
|
||||
|
|
Loading…
Reference in a new issue