Add a named column constraint - postgres docs
Arguments:
tablename
[Name] - name of the table to alterconstraint_name
[string] - name for the constraintexpression
[string or object] - constraint expression (raw sql) or definition:check
[string or array] - sql for a check constraint(s)unique
[Name or array of Names or array of arrays of Names] - names of unique columnsprimaryKey
[Name or array of Names] - names of primary columnsexclude
[string] - sql for an exclude constraintdeferrable
[boolean] - flag for deferrable table constraintdeferred
[boolean] - flag for initially deferred deferrable table constraintcomment
[string] - comment on a singular, named constraintforeignKeys
[object or array of objects] - foreign keys specificationcolumns
[Name or array of Names] - names of columnsreferences
[Name] - names of foreign table and column namesreferencesConstraintName
[string] - name of the created constraint (only necessary when creating multiple constraints)referencesConstraintComment
[string] - comment on the individual foreign key constraintonDelete
[string] - action to perform on deleteonUpdate
[string] - action to perform on updatematch
[string] -FULL
orSIMPLE
Aliases: createConstraint
Reverse Operation: dropConstraint
Drop a named column constraint - postgres docs
Arguments:
tablename
[Name] - name of the table to alterconstraint_name
[string] - name for the constraintoptions
[object] - options:ifExists
[boolean] - drops constraint only if it existscascade
[boolean] - drops also dependent objects
Rename a constraint - postgres docs
Arguments:
tablename
[Name] - name of the table to alterold_constraint_name
[string] - current constraint namenew_constraint_name
[string] - new constraint name
Reverse Operation: same operation in opposite direction