Skip to content

Commit 168616c

Browse files
Fixed an issue where table node in ERD was not showing geometry details.
1 parent fed17a5 commit 168616c

File tree

2 files changed

+7
-2
lines changed
  • web/pgadmin
    • browser/server_groups/servers/databases/schemas/tables/columns
    • tools/erd/static/js/erd_tool/nodes

2 files changed

+7
-2
lines changed

web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,9 @@ def fetch_length_precision(data):
452452
if 'typname' in data and (data['typname'] in ('geometry', 'geography')):
453453
# If we have geometry column
454454
parmas = parse_params(data['cltype'])
455-
data['geometry'] = parmas[0]
456-
data['srid'] = parmas[1]
455+
if parmas:
456+
data['geometry'] = parmas[0]
457+
data['srid'] = parmas[1]
457458
else:
458459
parmas = parse_params(fulltype)
459460

web/pgadmin/tools/erd/static/js/erd_tool/nodes/TableNode.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ export class TableNodeWidget extends React.Component {
312312
cltype += '('+ col.attlen + (col.attprecision ? ',' + col.attprecision : '') +')';
313313
}
314314

315+
if(col.geometry) {
316+
cltype += '('+ col.geometry + (col.srid ? ',' + col.srid : '') +')';
317+
}
318+
315319
return (
316320
<Box className='TableNode-columnSection' key={col.attnum} data-test="column-row">
317321
<Box marginRight="auto" padding="0" minHeight="0" display="flex" alignItems="center">

0 commit comments

Comments
 (0)