[ERD]: Let the user specify table inheritance in ERD tool (RM #7301)
Issue migrated from Redmine: https://redmine.postgresql.org/issues/7301 Originally created by Alessandro Martinelli at 2022-04-08 13:12:55 UTC.
As of now, in order to add an inheritance relationship between two tables, one needs to manually modify the SQL code generated by the ERD tool (attached picture Add table inheritance manually ). And this must be repeated every time the ERD is modified and tables are re-generated from it. The other option is to use a custom script to re-create tables requiring inheritance relationship and run it after tables generation. Howerver it would be nice if ERD tool could handle this on its own.
After tables have been created, inheritance relationship is visible from table properties (attached picture Modify table after creation ). It would be nice to have something like that in the ERD tool too (attached picture Modify table ERD )
Image migrated from Redmine: https://redmine.postgresql.org/attachments/download/6721 Originally created by Alessandro Martinelli at 2022-04-08 13:12:30 UTC.
Filename: Add_table_inheritance_manually.PNG
Image migrated from Redmine: https://redmine.postgresql.org/attachments/download/6722 Originally created by Alessandro Martinelli at 2022-04-08 13:12:33 UTC.
Filename: Modify_table_after_creation.PNG
Image migrated from Redmine: https://redmine.postgresql.org/attachments/download/6723 Originally created by Alessandro Martinelli at 2022-04-08 13:12:37 UTC.
Filename: Modify_table_ERD.PNG
Image migrated from Redmine: https://redmine.postgresql.org/attachments/download/6724 Originally created by Alessandro Martinelli at 2022-04-08 13:15:12 UTC.
Filename: Add_table_inheritance_manually.PNG
Image migrated from Redmine: https://redmine.postgresql.org/attachments/download/6725 Originally created by Alessandro Martinelli at 2022-04-08 13:15:16 UTC.
Filename: Modify_table_ERD.PNG
Comment migrated from Redmine: https://redmine.postgresql.org/issues/7301#note-6 Originally created by Alessandro Martinelli at 2022-04-08 13:15:26 UTC.
Redmine ticket header update:
| Name | Old Value | New Value |
|---|---|---|
| Attachment added | Modify table ERD.PNG | |
| Attachment added | Add table inheritance manually.PNG |
Comment migrated from Redmine: https://redmine.postgresql.org/issues/7301#note-7 Originally created by Alessandro Martinelli at 2022-04-08 13:19:19 UTC.
Please remove the first version of images Add table inheritance manually.PNG and Modify table ERD.PNG , uploaded at 13:12
Comment migrated from Redmine: https://redmine.postgresql.org/issues/7301#note-8 Originally created by Alessandro Martinelli at 2022-04-08 14:18:45 UTC.
I just realized that, if an user plans to use inheritance, there is a good possibility that he/she cannot use ERD tool at all: let's say you have table base and table a inheriting from base. base has a id fields which will be primary key for a too, thus in table a you will not specify the id field, since it will be inherited from base. If now you need to add table b with field b_a_id , which should be in 1-to-M relationship with a.id , you cannot do this in ERD tool since table a has no id field. So in this - not so specific - use case the user cannot use ERD tool at all.
Comment migrated from Redmine: https://redmine.postgresql.org/issues/7301#note-9 Originally created by Nikhil Mohite at 2022-05-13 11:13:53 UTC.
Redmine ticket header update:
| Name | Old Value | New Value |
|---|---|---|
| Assigned To changed | Aditya Toshniwal |
Comment migrated from Redmine: https://redmine.postgresql.org/issues/7301#note-10 Originally created by Aditya Toshniwal at 2022-05-19 04:44:02 UTC.
Redmine ticket header update:
| Name | Old Value | New Value |
|---|---|---|
| Sprint changed | Ready | |
| Assigned To changed | Aditya Toshniwal |
Comment migrated from Redmine: https://redmine.postgresql.org/issues/7301#note-11 Originally created by Aditya Toshniwal at 2022-05-19 04:44:37 UTC.
Redmine ticket header update:
| Name | Old Value | New Value |
|---|---|---|
| Relationship (duplicated) changed | RM #7395 |
Maybe the option would be that the inheriting table also displays the fields of the ancestor table, but visually they're greyed out or something, indicating that they're inherited, and from an SQL POV, they're not specified, just inherited. Then the inheritance relationship could be specified. For an example of what this might look like visually, see https://martinfowler.com/eaaCatalog/classTableInheritance.html .
Since 1-1 relationship has recently been added, maybe this should be based on that.