mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure the comment on a Primary Key constraint can be edited under the Table node. Fixes #4581
This commit is contained in:
parent
7f53e13aa7
commit
c29275011a
@ -42,4 +42,5 @@ Bug fixes
|
|||||||
| `Issue #4536 <https://redmine.postgresql.org/issues/4536>`_ - Fix load on demand in View/Edit data mode.
|
| `Issue #4536 <https://redmine.postgresql.org/issues/4536>`_ - Fix load on demand in View/Edit data mode.
|
||||||
| `Issue #4552 <https://redmine.postgresql.org/issues/4552>`_ - Fix some errors thrown on the JS console when dragging text in the Query Tool.
|
| `Issue #4552 <https://redmine.postgresql.org/issues/4552>`_ - Fix some errors thrown on the JS console when dragging text in the Query Tool.
|
||||||
| `Issue #4559 <https://redmine.postgresql.org/issues/4559>`_ - Ensure triggers should be updated properly for EPAS server.
|
| `Issue #4559 <https://redmine.postgresql.org/issues/4559>`_ - Ensure triggers should be updated properly for EPAS server.
|
||||||
| `Issue #4565 <https://redmine.postgresql.org/issues/4565>`_ - Fix the reverse engineered SQL for trigger functions with the WINDOW option selected.
|
| `Issue #4565 <https://redmine.postgresql.org/issues/4565>`_ - Fix the reverse engineered SQL for trigger functions with the WINDOW option selected.
|
||||||
|
| `Issue #4581 <https://redmine.postgresql.org/issues/4581>`_ - Ensure the comment on a Primary Key constraint can be edited under the Table node.
|
@ -1,7 +1,7 @@
|
|||||||
{### SQL to update constraint object ###}
|
{### SQL to update constraint object ###}
|
||||||
{% if data %}
|
{% if data %}
|
||||||
{# ==== To update constraint name ==== #}
|
{# ==== To update constraint name ==== #}
|
||||||
{% if data.name != o_data.name %}
|
{% if data.name and data.name != o_data.name %}
|
||||||
ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
|
ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
|
||||||
RENAME CONSTRAINT {{ conn|qtIdent(o_data.name) }} TO {{ conn|qtIdent(data.name) }};
|
RENAME CONSTRAINT {{ conn|qtIdent(o_data.name) }} TO {{ conn|qtIdent(data.name) }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -19,4 +19,4 @@ ALTER INDEX {{ conn|qtIdent(data.schema, data.name) }}
|
|||||||
COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(data.schema, data.table) }}
|
COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(data.schema, data.table) }}
|
||||||
IS {{ data.comment|qtLiteral }};
|
IS {{ data.comment|qtLiteral }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1325,6 +1325,10 @@ class BaseTableView(PGChildNodeView, BasePartitionTable):
|
|||||||
return internal_server_error(errormsg=res)
|
return internal_server_error(errormsg=res)
|
||||||
|
|
||||||
old_data = res['rows'][0]
|
old_data = res['rows'][0]
|
||||||
|
|
||||||
|
# If changes are from table node
|
||||||
|
if 'name' not in c:
|
||||||
|
c['name'] = old_data['name']
|
||||||
# Sql to update object
|
# Sql to update object
|
||||||
sql.append(
|
sql.append(
|
||||||
render_template("/".join([
|
render_template("/".join([
|
||||||
|
Loading…
Reference in New Issue
Block a user