1
Fork 0

add alter table variations:

set default
  drop default
  set not null
  drop not null
  set data type
  drop column
  add constraint
  drop constraint

fix bug where generated didn't have to be followed with 'always' or
  'by default' for identities in create table
This commit is contained in:
Jake Wheat 2015-08-02 23:22:06 +03:00
parent f6477ac214
commit f0baa3c37b
4 changed files with 218 additions and 54 deletions
Language/SQL/SimpleSQL

View file

@ -553,13 +553,18 @@ I'm not sure if this is valid syntax or not.
> data AlterTableAction =
> AddColumnDef ColumnDef
> {-
> | AlterColumnDef
> | DropColumnDef
> | AddTableConstraintDef
> | AlterTableConstraintDef
> | DropTableConstraintDef
> -}
> | AlterColumnSetDefault Name ValueExpr
> | AlterColumnDropDefault Name
> | AlterColumnSetNotNull Name
> | AlterColumnDropNotNull Name
> | AlterColumnSetDataType Name TypeName
> {- | AlterColumnAlterIdentity
> | AlterColumnDropIdentity
> | AlterColumnDropColumnGeneration-}
> | DropColumn Name DropBehaviour
> | AddTableConstraintDef (Maybe [Name]) TableConstraint
> -- | AlterTableConstraintDef
> | DropTableConstraintDef [Name] DropBehaviour
> deriving (Eq,Show,Read,Data,Typeable)
> {-data ConstraintCharacteristics =
@ -597,8 +602,7 @@ I'm not sure if this is valid syntax or not.
> deriving (Eq,Show,Read,Data,Typeable)
> data IdentityWhen =
> GeneratedDefault
> | GeneratedAlways
> GeneratedAlways
> | GeneratedByDefault
> deriving (Eq,Show,Read,Data,Typeable)