Fixed issue found while testing PostGIS spatial type constructor support. #2256
parent
038029eb2d
commit
78d9aa5b76
|
|
@ -5,7 +5,7 @@
|
|||
{### Add column ###}
|
||||
{% if data.name and data.cltype %}
|
||||
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
|
||||
ADD COLUMN {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.collspcname %}
|
||||
ADD COLUMN {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.geometry and not is_sql %}({{data.geometry}}{% if data.srid %},{{data.srid}}{% endif %}){% endif %}{% if data.collspcname %}
|
||||
COLLATE {{data.collspcname}}{% endif %}{% if data.attnotnull %}
|
||||
NOT NULL{% endif %}{% if data.defval is defined and data.defval is not none and data.defval != '' and data.colconstype != 'g' %}
|
||||
DEFAULT {{data.defval}}{% endif %}{% if data.colconstype == 'i' %}{% if data.attidentity and data.attidentity == 'a' %} GENERATED ALWAYS AS IDENTITY{% elif data.attidentity and data.attidentity == 'd' %} GENERATED BY DEFAULT AS IDENTITY{% endif %}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
{### Add column ###}
|
||||
{% if data.name and data.cltype %}
|
||||
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
|
||||
ADD COLUMN {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.collspcname %}
|
||||
ADD COLUMN {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.geometry and not is_sql %}({{data.geometry}}{% if data.srid %},{{data.srid}}{% endif %}){% endif %}{% if data.collspcname %}
|
||||
COLLATE {{data.collspcname}}{% endif %}{% if data.attnotnull %}
|
||||
NOT NULL{% endif %}{% if data.defval is defined and data.defval is not none and data.defval != '' and data.colconstype != 'g' %}
|
||||
DEFAULT {{data.defval}}{% endif %}{% if data.colconstype == 'i' %}{% if data.attidentity and data.attidentity == 'a' %} GENERATED ALWAYS AS IDENTITY{% elif data.attidentity and data.attidentity == 'd' %} GENERATED BY DEFAULT AS IDENTITY{% endif %}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
|
|||
|
||||
{% endif %}
|
||||
{### Alter column type and collation ###}
|
||||
{% if (data.cltype and data.cltype != o_data.cltype) or (data.attlen is defined and data.attlen != o_data.attlen) or (data.attprecision is defined and data.attprecision != o_data.attprecision) or (data.collspcname and data.collspcname != o_data.collspcname) or data.col_type_conversion is defined %}
|
||||
{% if (data.cltype and data.cltype != o_data.cltype) or (data.geometry is defined and data.geometry != o_data.geometry) or (data.srid is defined and data.srid != o_data.srid) or (data.attlen is defined and data.attlen != o_data.attlen) or (data.attprecision is defined and data.attprecision != o_data.attprecision) or (data.collspcname and data.collspcname != o_data.collspcname) or data.col_type_conversion is defined %}
|
||||
{% if data.col_type_conversion is defined and data.col_type_conversion == False %}
|
||||
-- WARNING:
|
||||
-- The SQL statement below would normally be used to alter the datatype for the {{o_data.name}} column, however,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
{### Add column ###}
|
||||
{% if data.name and data.cltype %}
|
||||
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
|
||||
ADD COLUMN {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.collspcname %}
|
||||
ADD COLUMN {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.geometry and not is_sql %}({{data.geometry}}{% if data.srid %},{{data.srid}}{% endif %}){% endif %}{% if data.collspcname %}
|
||||
COLLATE {{data.collspcname}}{% endif %}{% if data.attnotnull %}
|
||||
NOT NULL{% endif %}{% if data.defval is defined and data.defval is not none and data.defval != '' and data.colconstype != 'g' %}
|
||||
DEFAULT {{data.defval}}{% endif %}{% if data.colconstype == 'i' %}{% if data.attidentity and data.attidentity == 'a' %} GENERATED ALWAYS AS IDENTITY{% elif data.attidentity and data.attidentity == 'd' %} GENERATED BY DEFAULT AS IDENTITY{% endif %}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
|
|||
|
||||
{% endif %}
|
||||
{### Alter column type and collation ###}
|
||||
{% if (data.cltype and data.cltype != o_data.cltype) or (data.attlen is defined and data.attlen != o_data.attlen) or (data.attprecision is defined and data.attprecision != o_data.attprecision) or (data.collspcname and data.collspcname != o_data.collspcname) or data.col_type_conversion is defined %}
|
||||
{% if (data.cltype and data.cltype != o_data.cltype) or (data.geometry is defined and data.geometry != o_data.geometry) or (data.srid is defined and data.srid != o_data.srid) or (data.attlen is defined and data.attlen != o_data.attlen) or (data.attprecision is defined and data.attprecision != o_data.attprecision) or (data.collspcname and data.collspcname != o_data.collspcname) or data.col_type_conversion is defined %}
|
||||
{% if data.col_type_conversion is defined and data.col_type_conversion == False %}
|
||||
-- WARNING:
|
||||
-- The SQL statement below would normally be used to alter the datatype for the {{o_data.name}} column, however,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
{### Add column ###}
|
||||
{% if data.name and data.cltype %}
|
||||
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
|
||||
ADD COLUMN IF NOT EXISTS {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.collspcname %}
|
||||
ADD COLUMN IF NOT EXISTS {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.geometry and not is_sql %}({{data.geometry}}{% if data.srid %},{{data.srid}}{% endif %}){% endif %}{% if data.collspcname %}
|
||||
COLLATE {{data.collspcname}}{% endif %}{% if data.attnotnull %}
|
||||
NOT NULL{% endif %}{% if data.defval is defined and data.defval is not none and data.defval != '' %}
|
||||
DEFAULT {{data.defval}}{% endif %}{% if data.colconstype == 'i' %}{% if data.attidentity and data.attidentity == 'a' %} GENERATED ALWAYS AS IDENTITY{% elif data.attidentity and data.attidentity == 'd' %} GENERATED BY DEFAULT AS IDENTITY{% endif %}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
|
|||
|
||||
{% endif %}
|
||||
{### Alter column type and collation ###}
|
||||
{% if (data.cltype and data.cltype != o_data.cltype) or (data.attlen is defined and data.attlen != o_data.attlen) or (data.attprecision is defined and data.attprecision != o_data.attprecision) or (data.collspcname and data.collspcname != o_data.collspcname) or data.col_type_conversion is defined %}
|
||||
{% if (data.cltype and data.cltype != o_data.cltype) or (data.geometry is defined and data.geometry != o_data.geometry) or (data.srid is defined and data.srid != o_data.srid) or (data.attlen is defined and data.attlen != o_data.attlen) or (data.attprecision is defined and data.attprecision != o_data.attprecision) or (data.collspcname and data.collspcname != o_data.collspcname) or data.col_type_conversion is defined %}
|
||||
{% if data.col_type_conversion is defined and data.col_type_conversion == False %}
|
||||
-- WARNING:
|
||||
-- The SQL statement below would normally be used to alter the datatype for the {{o_data.name}} column, however,
|
||||
|
|
|
|||
|
|
@ -73,6 +73,6 @@ time({{ data.attlen }}) with time zone {% endif %}{% if o_data.hasSqrBracket %}[
|
|||
{% if data.attlen and data.attlen is not none %}
|
||||
({{ data.attlen }}{% elif old_length and old_length is not none %}({{ old_length }}{% endif %}{% if data_precision and data_precision is not none %}
|
||||
, {{ data_precision }}){% elif old_precision and old_precision is not none %}, {{ old_precision }}){% else %}){% endif %}
|
||||
{% endif %}{% if o_data.hasSqrBracket %}[]{% endif %}
|
||||
{% endif %}{% if data.geometry %}({{ data.geometry }}{% elif o_data.geometry %}({{ o_data.geometry }}{% endif %}{% if data.srid %},{{ data.srid }}){% elif o_data.srid %},{{ o_data.srid }}){% endif %}{% if o_data.hasSqrBracket %}[]{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class EmptySchema extends BaseUISchema {
|
|||
}
|
||||
}
|
||||
|
||||
export function getTableDialogSchema(attributes, isNew, tableNodesDict, colTypes, schemas) {
|
||||
export function getTableDialogSchema(attributes, isNew, tableNodesDict, colTypes, schemas, geometryTypes) {
|
||||
let treeNodeInfo;
|
||||
|
||||
let columnSchema = new ColumnSchema(
|
||||
|
|
@ -31,7 +31,7 @@ export function getTableDialogSchema(attributes, isNew, tableNodesDict, colTypes
|
|||
treeNodeInfo,
|
||||
()=>colTypes,
|
||||
()=>[],
|
||||
()=>[],
|
||||
()=>geometryTypes,
|
||||
true,
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue