Skip to main content
Version: 2.0.0 (latest)

6.4. Model fix tool

Sometimes, during the loading of a database model file, an error message like the image below can be raised by pgModeler. This error happens mainly because the user ignored the model validation warnings and saved the model or loaded a file that was generated in an older version of pgModeler that contains some incompatibilities with the current version. In both cases, the file is corrupted and will be loadable again only if a set of patches is applied to its structure.

ch6.model-fix-error.dialog

Originally, this model fix feature was implemented only in the command-line interface version of pgModeler, but to facilitate the interaction with the user, a graphical interface to the command-line tool was implemented, resulting in the dialog described below. The only task executed by this dialog is to take an input model file (the broken one), an output file (where the fixed model will be stored), and call the command-line interface to do the fix task. The user can follow the whole process on the console-like field located at the center of the dialog.

It is possible to use this dialog at any time, not necessarily only on loading errors. If you have broken models and want to fix them before loading, just switch to the Fix view (in the views bar of the main window) and select the tool Model file. The available fields of the dialog are detailed below.

ch6.model-fix12345678910

Model fix
#FieldDescription
1pgmodeler-cli

The path of the pgmodeler-cli executable used to fix the model.

2Select file

Opens a dialog to select the pgmodeler-cli executable.

3Input file

The broken model file to be fixed.

4Select file

Opens a dialog to select the model file to be fixed.

5Output file

The file in which the fixed database model will be stored.

6Select file

Opens a dialog to select the file that receives the fixed model.

7Generate file name

Generates the name of the output file from the name of the input file, appending the suffix _fixed_YYYYMMDD_hhmmss.

8Fix tries

The number of attempts made by the fix process (from 1 to 100, the default is 10). Generally, there is no need to change this value, but depending on the arrangement and size of the model, you can increase it to fix a broken model correctly.

9Load fixed model when finish

When checked, pgModeler loads the fixed model when the process finishes.

10Output

Shows the output of the fix process.