这是indexloc提供的服务,不要输入任何密码
Skip to content

ERD Tool - Primary key constraints is not updated after the checkbox for primary key is unchecked #7476

@petkorutesic

Description

@petkorutesic

Changing a primary key constraints or even deleting attributes does not change the constraints in the "Constraints" tab

Removing an attribute does not change the constraints defined on that attribute.

To Reproduce

Steps to reproduce the behavior:

  1. Define the primary key constraint on a table and save the whole project in the ERD Tool.

  2. Double-click on the table in the diagram, and the form for editing table properties will open. The checkbox for the primary key can now be unchecked. However, saving your changes does not exclude the primary key constraints. The primary key constraint can still be found if you open the "Constraints" tab. Moreover, even if we completely remove the attribute on which the primary constraint is defined, the constraint still remains in the "Constraints" tab.

  3. This can cause problems and is annoying if you click on the "Generate SQL" option which generates SQL DDL statements with unwanting constraints or constraints on unexisting attributes.

Expected behavior

It would be natural that the ERD Tools shows a dialogue form to confirm an automatic delete of the primary key constraint if this constraint is removed in the tab "Columns" that contains the list of attributes.

Screenshots

Screenshot 2024-05-15 at 12 52 23

After we remove the attribute with the primary key:
Screenshot 2024-05-15 at 13 48 23

However, the constraint is still there:
Screenshot 2024-05-15 at 13 33 12

Error message if the generated DDL SQL is run

Screenshot 2024-05-15 at 13 53 17

Software

  • MacOS: [OSX Sonoma 14.5 - macOS-14.5-x86_64-i386-64bit]
  • pgAdmin4 Version: 8.6
    NW.js Version: 0.77.0
  • Mode: Desktop
  • Browser: Chromium 114.0.5735.91

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions