This works with one version of the database and if we migrate the database to a newer version and modify the tables a bit. This causes error. One scenario is adding an extra field to a relation and after migration this plugin causes errors.