After NXS-4206 , we have to create a solution to clean its consequences for affected customers.
Backends for solution
- PostgreSQL
Solution should:
- Get studio vocabularies list by retrieving the studio_vocabulary* tables
- Check for each vocabulary if a table exists with the vocabulary name and appropriate structure (unprefixed) => if it doesn't, continue with next vocabulary
- When both tables exist:
- Copy new entries into prefixed table
- Conflicting entries (same id in both tables) should be added to a log file with a mention: "[Date and time] - [vocabulary name] - entry [id] [label] could not be merged due to a conflict."
When merge is over, add an entry in the logs with:
- "[Date and time] Finished merging [number of vocabularies] Studio vocabularies. To finish cleanup, delete the associated unprefixed tables by running the SQL query below."
- the SQL command to run in order to delete the unprefixed tables so that user can check result and delete tables when ready for it