OnroerendErfgoed / atramhasis

An online SKOS editor
http://atramhasis.readthedocs.io/
GNU General Public License v3.0
53 stars 11 forks source link

Provider ids have changed from text to numeric #833

Closed koenedaele closed 1 year ago

koenedaele commented 1 year ago

After migrating providers from code to the DB, ids have changed. Where the URL for heritage types used to be http://localhost:6543/conceptschemes/HERITAGETYPE, it is now http://localhost:6543/conceptschemes/6.

Looking at the DB I see the following:

6|6|https://id.erfgoed.net/thesauri/erfgoedtypes/%s|{"id": "HERITAGETYPE", "dataset": {"uri": "https://id.erfgoed.net/datasets/thesauri/erfgoedtypes", "publisher": ["https://id.erfgoed.net/actoren/501"], "created": ["2008-02-14"], "language": ["nl-BE"], "license": ["https://creativecommons.org/licenses/by/4.0/", "http://data.vlaanderen.be/doc/licentie/modellicentie-gratis-hergebruik/v1.0"]}, "subject": [], "atramhasis.id_generation_strategy": "NUMERIC"}|RECURSE

So, the provider now has a numeric id (6), but in the JSON the old textual ID is still present. Yet, it's no longer used when generating the URL's, thus breaking them.

vancamti commented 1 year ago

Do we already have live data that needs to be corrected via alembic migration or is it only the migrate_sqlalchemy_providers script that needs an update ?

koenedaele commented 1 year ago

This script hasn't run on production data yet, since Atramhasis 2.0.0 hasn't been released yet. So, only the script needs to be updated.