v0.9.3 Summary Chapter 7: Modeling tips and tricks 7. Introduction 7.18. Managing relationship generated objects

7.18. Managing relationship generated objects

In newer releases, pgModeler allows a way to edit relationship-generated objects. By default, when the user creates a one-to-one, one-to-many or many-to-many relationship, pgModeler will create and lock the objects (columns and constraints) that represent the link between the tables. This is done because the tool needs full control over those objects in order to propagate name changes and other attributes making repetitive operations of linking tables via foreign key constraints more quick and pleasant. This feature is called column propagation.

The drawback of those objects' locks is that the user isn't able to change their attributes which, in some really specific scenarios, is a bad thing. Thinking of these specific cases, one is able to "convert" the relationships in such a way that the locks are removed and the user is free to change the columns and constraints structures. Basically, converting a one-to-one or one-to-many relationship will cause the detachment (unlocking) of the objects that represent the relationship generating an FK relationship instead. Such conversion feature already exists for many-to-many relationships. The only drawback of converting a relationship is that the user loses the column propagation feature for any converted relationship, being up to him/her to change any of the attributes of the objects that are related to the linking between tables.

The image below demonstrates the same relationship before and after the conversion. In the first case, the relationship is still an ordinary one-to-many being the column id_table_a and the constraint table_a_fk the objects locked and managed by it. After the conversion, which is triggered by a right-click on the relationship and choosing Convert, an FK relationship is created in place and the objects id_table_a and table_a_fk are now unlocked for any kind of modification.

This section closes the last chapter that describes all features available in pgModeler. Now, I hope that beginners and expert users can be able to use the tool more comfortably in their daily job. The important message to be given after detailing some tricks about pgModeler is that, like many other softwares, it offers different ways to achieve the same result as we could see in many chapters of this documentation. In the next chapter, we'll see advanced topics that are not necessarily related to modeling and database management but they somehow can be useful for expert users.


Mar 25, 2021 at 15:14