When running the 2.1 to 2.2 upgrade scripts, you may run into the following Error Code: Detected metadata name(s) Run helper script SelectInvalidMetadataNames.sql
This means that the type record associated certain metadata names are not correct.
Resolution
This is a multi-step manual process that begins with the running the following SQL:
-- -- Selects metadata names that have the same name but different types. -- SELECT name, type, asset_type, multi_valued FROM metadatanames WHERE name IN ( SELECT name FROM (SELECT COUNT(*), name, type, asset_type, multi_valued FROM metadatanames GROUP BY name, type) AS mn GROUP BY name HAVING COUNT(*) > 1 ); -- -- Selects metadata names that have the same name but different multi-valued flags. -- SELECT name, type, asset_type, multi_valued FROM metadatanames WHERE name IN ( SELECT name FROM (SELECT COUNT(*), name, type, asset_type, multi_valued FROM metadatanames GROUP BY name, multi_valued) AS mn GROUP BY name HAVING COUNT(*) > 1 );
The output will be similar to this:
The multiple metadata names may have different type values. This is what is causing the problem. Your next step would copy a value in the name column and run the below query:
SELECT * FROM curatordb.metadatanames where name = 'NAME';
The output will be similar to this:
You will need to select a name_id value and use the following query:
SELECT * FROM curatordb.metadatavalues where name_id = '(‘name_id” value)';
This query will return the following output:
The table below shows what the actual type value should actually be and should be updated in the database as such.
Type |
Type Name |
1 |
Text |
2 |
Int |
3 |
Float |
4 |
Enum |
5 |
DateTime |
6 |
FilePath |
7 |
Uri |
8 |
Boolean |
9 |
Guid |
10 |
Blob |
11 |
Json |