Skip to content

Commit c1e7467

Browse files
committed
Allow users to customize ofType columns during table creation #223
1 parent 5103c47 commit c1e7467

File tree

9 files changed

+2312
-1268
lines changed

9 files changed

+2312
-1268
lines changed

web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,20 @@ def get_oftype(self, gid, sid, did, scid, tid=None):
797797
if not status:
798798
return internal_server_error(errormsg=type_cols)
799799

800+
# Mark columns as inherited from type (not table)
801+
# so the UI allows editing defaults/constraints
802+
# Also store original values for comparison later
803+
for col in type_cols['rows']:
804+
if 'inheritedfrom' in col:
805+
col['inheritedfromtype'] = col['inheritedfrom']
806+
# Keep inheritedfrom for backward compatibility
807+
# but UI will check inheritedfromtype first
808+
809+
# Store original values from the composite type
810+
# This allows backend to detect actual modifications
811+
col['original_defval'] = col.get('defval')
812+
col['original_attnotnull'] = col.get('attnotnull', False)
813+
800814
res.append({
801815
'label': row['typname'],
802816
'value': row['typname'],

0 commit comments

Comments
 (0)