Create a new table - postgres docs
Arguments:
tablename
[Name] - name for the new tablecolumns
[object] - column names / options -- see column definitions sectionoptions
[object] - table options (optional)temporary
[bool] - default falseifNotExists
[bool] - default falseinherits
[Name] - table(s) to inherit fromconstraints
[object] - table constraints seeexpression
of add constraintlike
either:- [Name] - table(s) to inherit from
- or [object]
table
[Name] - table(s) to inherit fromoptions
[object] - like options (optional)including
[string or array of strings] - 'COMMENTS', 'CONSTRAINTS', 'DEFAULTS', 'IDENTITY', 'INDEXES', 'STATISTICS', 'STORAGE', 'ALL'excluding
[string or array of strings] - 'COMMENTS', 'CONSTRAINTS', 'DEFAULTS', 'IDENTITY', 'INDEXES', 'STATISTICS', 'STORAGE', 'ALL'
comment
[string] - adds comment on table
Reverse Operation: dropTable
Drop existing table - postgres docs
Arguments:
tablename
[Name] - name of the table to dropoptions
[object] - options:ifExists
[boolean] - drops table only if it existscascade
[boolean] - drops also dependent objects
Rename a table - postgres docs
Arguments:
Reverse Operation: same operation in opposite direction
Alter existing table - postgres docs
Arguments:
tablename
[Name] - name of the table to alteroptions
[object] - options:levelSecurity
[string] -DISABLE
,ENABLE
,FORCE
, orNO FORCE