ec-jrc / re3gistry

Re3gistry is a reusable open source solution for managing and sharing ‘reference codes’, ensuring semantic interoperability across organisations.
European Union Public License 1.2
29 stars 21 forks source link

Errors in migration of the database tables from an existing Re3gistry installation #31

Closed AntoRot closed 3 years ago

AntoRot commented 3 years ago

After installing the Re3gistry 2 core app (see the steps followed in #30), I started the installation wizard choosing the migration option.

The migration failed and I got the following error notification by email

immagine

Taking a look to the log, the error was raised for the violation of a foreign key as the values in the column “localid” in the table reg_group shall be unique.

Thanks to the support of the Re3gistry team, I realized that the error was due to a wrong/different mapping in the migration procedure between the table "reference" in the old Re3gistry DB schema and the table "reg_group" in the new one. The table "reference" in the Italian installation indeed included more records with the same "reftype", i.e. registermanager and registerowner (see below), that was not wrong, whereas in the table "reg_group" the "localid" (corresponding to the mentioned "reftype") shall be unique. uuid email reftype datecreation datelastupdate
1 info@rndt.gov.it contactpoint 2014-10-14 00:00:00
2 legalnotice 2014-10-14 00:00:00
3 info@rndt.gov.it controlbody 2014-10-14 00:00:00
4 info@rndt.gov.it registrymanager 2014-10-14 00:00:00
5 info@rndt.gov.it registermanager 2014-10-14 00:00:00
6 info@rndt.gov.it registerowner 2014-10-14 00:00:00
7 registersubmitter 2014-10-14 00:00:00
8 registermanager 2014-10-14 00:00:00
9 registerowner 2014-10-14 00:00:00
10 registermanager 2019-06-05 00:00:00
11 registerowner 2019-06-05 00:00:00
12 sisterritoriale@protezionecivile.it registermanager 2019-11-18 12:16:00
13 sisterritoriale@protezionecivile.it registerowner 2019-11-18 12:17:00

The migration procedure should also consider this different mapping between the two mentioned tables.

Moreover, if the master language is not English, the language values in the column “reg_languagecode” ("en" by default) of the table “reg_statuslocalization” are not updated (with "it" in our case) after the migration process, although the value "true" was properly set for Italian in the column “masterlanguage” of the table “reg_languagecode”. That prevents the registers, itemclasses and items from being visualised in the Re3gistry reference codes management tool if a language other than English is selected and an error message appears as shown in the following image.

immagine

df-git commented 3 years ago

Solved in release v2.1.0.