cessda / cessda.cvs.two

Apache License 2.0
0 stars 2 forks source link

New versioning of CVs with only source language #607

Closed MajaDolinar closed 1 year ago

MajaDolinar commented 1 year ago

DDI has brought to my attention that the CVs that are in the system only in English (source language) have been put by the new versioning system automatically to a higher version, where there was an increase in the 3-digit versioning. It says in the version history that this change happened automatically with the move to the new versioning system. According to our versioning policy a vocabulary that has only the source language gets 1.0.0 (or other changes in the first 2 numbers), and the third number is affected only, if there would be a change in translation (as is not the case for these vocabulaires that have currently no translations). See examples: https://vocabularies.cessda.eu/vocabulary/CessdaPersistentIdentifierTypes?lang=en https://vocabularies.cessda.eu/vocabulary/CharacterSet?lang=en https://vocabularies.cessda.eu/vocabulary/CountryNamesAndCodes?lang=en https://vocabularies.cessda.eu/vocabulary/NumericType?lang=en https://vocabularies.cessda.eu/vocabulary/SoftwarePackage?lang=en https://vocabularies.cessda.eu/vocabulary/TimeZone?lang=en https://vocabularies.cessda.eu/vocabulary/TypeOfAddress?lang=en https://vocabularies.cessda.eu/vocabulary/TypeOfFrequency?lang=en https://vocabularies.cessda.eu/vocabulary/TypeOfTelephone?lang=en https://vocabularies.cessda.eu/vocabulary/TypeOfTranslationMethod?lang=en

I had a discussion also with Taina, and we both think that this should be changed only to 1.0.0 for all of these examples, as DDI is asking, otherwise it creates a confusion in the use of versioning. Taina is no longer sure why this happened and what was the issue behind that this was done in this way. She mentions a possible technical issue that she did not quite understand (some tables in the database?), so I am asking you to have a look at this and see if we can change this to 1.0.0 and/or explain what is the issue behind this.

pakoselo commented 1 year ago

@MajaDolinar I have looked into the DB and also had a small talk with @Stifo . Probably there was a problem with communication or misunderstanding (between @stifo and Taina), but @Stifo automatically increase every CV from 2 digit to 3 digit by adding +1 at the end (increasing patch number, but that time he doesn't probably know this). You are right it should be 1.0.0 in 8 cases and 1.1.0 in other 2 of them (identified by you). Best approach to solve this issue will be to patch the DB, by rewriting the patch number (3rd digit) to "0". Also I have identified another one https://vocabularies.cessda.eu/vocabulary/TypeOfNote?lang=en . Probably this should be corrected too. @Joshua-cessda-admin can you please provide the latest dump of the production DB? We will need to test it locally.

MajaDolinar commented 1 year ago

Great if it can be changed. Please do that, and change all of these to .0, so that the whole versioning will work as planned. And yes, you are right, Type of Note should also be included in this.

Joshocan commented 1 year ago

@Stifo @pakoselo Production Db dump sent to you.

pakoselo commented 1 year ago

@Joshocan @MajaDolinar Can somebody of you please check the https://vocabularies.cessda.eu/vocabulary/CountryNamesAndCodes?lang=en CV in the editor as I don't have the rights to do it. Because in shows in the vocabulary table of the DB as a DRAFT, but probably this is an error. It should be published. If there is no DRAFT version I will fix it also in the table.

MajaDolinar commented 1 year ago

@pakoselo I checked and there is no draft version, only published. So yes, please correct this in the table.

pakoselo commented 1 year ago

@MajaDolinar I know how it happens, that we have such version created. @Stifo done it in that way, that as we have the 3 digit version of vocabulary, we must to increment it. That time it wasn't clear how the 3 digit version works and it obviously can't be that we are going from 1.0 to 1.0.0. It doesn't make sense. On the other hand it can be done that way (it will produce a confusion, because user will see two 1.0.0. versions - the older one is original 1.0 and 1.1.0 with 1.1). We need also patch the URN(s) and CODE(s). My other solution is to remove this versions and works with the original ones 1.0 and 1.1 and the system adds automatically the last zero (that mechanism is already there). Problems are with CODE(S) and URN(S) as they are in the database with 2 digit system. But, they can be updated to 3 digit version. Or the last solution will be to update 1.0 to 1.1.0 and 1.1 to 1.2.0 as a new SL versions. Still needed to update the CODE(S) and URN(S). So we have 3 different approaches how-to solve it, all of them involving lot of database patching issues.

MajaDolinar commented 1 year ago

Do the second solution: remove this versions and works with the original ones 1.0 and 1.1 and the system adds automatically the last zero (that mechanism is already there). Problems are with CODE(S) and URN(S) as they are in the database with 2 digit system. But, they can be updated to 3 digit version

pakoselo commented 1 year ago

@Joshocan can you please execute this script on the dev and staging environments please? Maybe it will be good to redeploy there production database to check if it works (probably the user table should be backed up, so we at IISAS and probably others don't loose the access). And then @MajaDolinar test it little bit please. I test it locally in my environment and everything looks good. @Joshocan please let me know in any case of errors or if there will not be any match on some of the queries.


SET SQL_SAFE_UPDATES = 0;

delete from concept where ((uri LIKE "%1.0.1%") and (
uri LIKE "%CharacterSet%" or 
uri like "%SoftwarePackage%" or
uri like "%TypeOfTelephone%" or
uri like "%TimeZone%" or
uri like "%CessdaPersistentIdentifierTypes%" or
uri like "%CountryNamesAndCodes%" or
uri like "%TypeOfTranslationMethod%" or
uri like "%TypeOfFrequency%"
));

delete from concept where ((uri LIKE "%1.1.1%") and (
uri LIKE "%NumericType%" or 
uri like "%TypeOfAddress%" or
uri like "%TypeOfNote%"));

DELETE FROM comment WHERE version_id=731;

DELETE FROM version WHERE (
    (notation='CharacterSet' or 
    notation='SoftwarePackage' or 
    notation='TypeOfTelephone' or 
    notation='TimeZone' or 
    notation='CessdaPersistentIdentifierTypes' or 
    notation='CountryNamesAndCodes' or
    notation='TypeOfTranslationMethod' or
    notation='TypeOfFrequency') and version_notes LIKE "%To align%");

DELETE FROM version WHERE (
    (notation='NumericType' or
    notation='TypeOfAddress' or
    notation='TypeOfNote') and uri LIKE "%1.1.1%");

update vocabulary set version_number="1.0.0", version_en="1.0.0" where version_number="1.0.1";
update vocabulary set version_number="1.1.0", version_en="1.1.0" where version_number="1.1.1";
update vocabulary set uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfFrequency" where notation="TypeOfFrequency";
update vocabulary set status='PUBLISHED' where notation='CountryNamesAndCodes';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:CharacterSet:1.0.0", 
citation="DDI Alliance. (2020). Character Set (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:CharacterSet:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/CharacterSet/1.0.0/" 
where notation="CharacterSet" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:SoftwarePackage:1.0.0", 
citation="DDI Alliance. (2020). Software Package (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:SoftwarePackage:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/SoftwarePackage/1.0.0/" 
where notation="SoftwarePackage" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfTelephone:1.0.0", 
citation="DDI Alliance. (2020). Type of Telephone (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfTelephone:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfTelephone/1.0.0/" 
where notation="TypeOfTelephone" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TimeZone:1.0.0", 
citation="DDI Alliance. (2020). Time Zone (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TimeZone:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TimeZone/1.0.0/" 
where notation="TimeZone" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:CessdaPersistentIdentifierTypes:1.0.0", 
citation="CESSDA. (2020). CESSDA Persistent Identifier Types (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:CessdaPersistentIdentifierTypes:1.0.0.", 
number="1.0.0", 
uri="https://vocabularies.cessda.eu/vocabulary/CessdaPersistentIdentifierTypes?v=1.0.0" 
where notation="CessdaPersistentIdentifierTypes" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:CountryNamesAndCodes:1.0.0", 
citation="CESSDA. (2020). Country Names and Codes (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:CountryNamesAndCodes:1.0.0.", 
number="1.0.0", 
uri="https://vocabularies.cessda.eu/vocabulary/CountryNamesAndCodes?v=1.0.0"
where notation="CountryNamesAndCodes" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfTranslationMethod:1.0.0", 
citation="DDI Alliance. (2022). Type of Translation Method (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfTranslationMethod:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfTranslationMethod/1.0.0/" 
where notation="TypeOfTranslationMethod" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfFrequency:1.0.0", 
citation="DDI Alliance. (2023). Type of Frequency (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfFrequency:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfFrequency/1.0.0/" 
where notation="TypeOfFrequency" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfAddress:1.0.0", 
citation="DDI Alliance. (2020). Type of Address (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfAddress:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfAddress/1.0.0/" 
where notation="TypeOfAddress" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfNote:1.0.0", 
citation="DDI Alliance. (2020). Type of Note (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfNote:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfNote/1.0.0/" 
where notation="TypeOfNote" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:NumericType:1.0.0", 
citation="DDI Alliance. (2019). Numeric Type (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:NumericType:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/NumericType/1.0.0/" 
where notation="NumericType" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfAddress:1.1.0", 
citation="DDI Alliance. (2020). Type of Address (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfAddress:1.1.0.", 
number="1.1.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfAddress/1.1.0/" 
where notation="TypeOfAddress" and number='1.1';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfNote:1.1.0", 
citation="DDI Alliance. (2020). Type of Note (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfNote:1.1.0.", 
number="1.1.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfNote/1.1.0/" 
where notation="TypeOfNote" and number='1.1';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:NumericType:1.1.0", 
citation="DDI Alliance. (2019). Numeric Type (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:NumericType:1.1.0.", 
number="1.1.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/NumericType/1.1.0/" 
where notation="NumericType" and number='1.1';

SET SQL_SAFE_UPDATES = @SQL_SAFE_UPDATES;```
Joshocan commented 1 year ago

@pakoselo I run into errors on some of queries.

mysql> DELETE FROM version WHERE ( p -> (notation='CharacterSet' or -> notation='SoftwarePackage' or -> notation='TypeOfTelephone' or -> notation='TimeZone' or -> notation='CessdaPersistentIdentifierTypes' or -> notation='CountryNamesAndCodes' or -> notation='TypeOfTranslationMethod' or -> notation='TypeOfFrequency') and version_notes LIKE "%To align%"); ) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfNote:1.0.0.", number="1.0.ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (cvs.comment, CONSTRAINTFK1mb0ovo2udq5s2jj7kxyq7akcFOREIGN KEY (version_id) REFERENCESversion(id))

pakoselo commented 1 year ago

@Joshocan and probably this DELETE FROM comment WHERE version_id=731; line produce 0 changes. My fault it can't be referred by ID as the database is created from scratch. The number will change every time. I will rewrite this line and sent the script back to you.

pakoselo commented 1 year ago

@Joshocan No it should work, in the meantime, somebody add something in the comments. Can you please send me the latest version of production database, please? I am referring the version ID, which can't be changed over versions. Somebody is probably trying to comment on these vocabularies (and I don't know which - so I can delete all comments referring these bad vocabularies and it will probably work). So ignore my previous comment. It should work. Next time, can you post complete log please?

pakoselo commented 1 year ago

@Joshocan this should delete potentially all comments to the broken versions.

SET @SQL_SAFE_UPDATES=@@SQL_SAFE_UPDATES;
SET SQL_SAFE_UPDATES = 0;

delete from concept where ((uri LIKE "%1.0.1%") and (
uri LIKE "%CharacterSet%" or 
uri like "%SoftwarePackage%" or
uri like "%TypeOfTelephone%" or
uri like "%TimeZone%" or
uri like "%CessdaPersistentIdentifierTypes%" or
uri like "%CountryNamesAndCodes%" or
uri like "%TypeOfTranslationMethod%" or
uri like "%TypeOfFrequency%"
));

delete from concept where ((uri LIKE "%1.1.1%") and (
uri LIKE "%NumericType%" or 
uri like "%TypeOfAddress%" or
uri like "%TypeOfNote%"));

DELETE FROM comment WHERE 
    version_id=672 or
    version_id=692 or
    version_id=693 or
    version_id=696 or
    version_id=697 or
    version_id=698 or
    version_id=699 or
    version_id=729 or
    version_id=731 or
    version_id=733 or
    version_id=734;

DELETE FROM version WHERE (
    (notation='CharacterSet' or 
    notation='SoftwarePackage' or 
    notation='TypeOfTelephone' or 
    notation='TimeZone' or 
    notation='CessdaPersistentIdentifierTypes' or 
    notation='CountryNamesAndCodes' or
    notation='TypeOfTranslationMethod' or
    notation='TypeOfFrequency' or
    notation='NumericType' or
    notation='TypeOfAddress' or
    notation='TypeOfNote') and version_notes LIKE "%To align%");

update vocabulary set version_number="1.0.0", version_en="1.0.0" where version_number="1.0.1";
update vocabulary set version_number="1.1.0", version_en="1.1.0" where version_number="1.1.1";
update vocabulary set uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfFrequency" where notation="TypeOfFrequency";
update vocabulary set status='PUBLISHED' where notation='CountryNamesAndCodes';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:CharacterSet:1.0.0", 
citation="DDI Alliance. (2020). Character Set (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:CharacterSet:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/CharacterSet/1.0.0/" 
where notation="CharacterSet" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:SoftwarePackage:1.0.0", 
citation="DDI Alliance. (2020). Software Package (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:SoftwarePackage:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/SoftwarePackage/1.0.0/" 
where notation="SoftwarePackage" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfTelephone:1.0.0", 
citation="DDI Alliance. (2020). Type of Telephone (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfTelephone:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfTelephone/1.0.0/" 
where notation="TypeOfTelephone" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TimeZone:1.0.0", 
citation="DDI Alliance. (2020). Time Zone (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TimeZone:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TimeZone/1.0.0/" 
where notation="TimeZone" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:CessdaPersistentIdentifierTypes:1.0.0", 
citation="CESSDA. (2020). CESSDA Persistent Identifier Types (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:CessdaPersistentIdentifierTypes:1.0.0.", 
number="1.0.0", 
uri="https://vocabularies.cessda.eu/vocabulary/CessdaPersistentIdentifierTypes?v=1.0.0" 
where notation="CessdaPersistentIdentifierTypes" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:CountryNamesAndCodes:1.0.0", 
citation="CESSDA. (2020). Country Names and Codes (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:CountryNamesAndCodes:1.0.0.", 
number="1.0.0", 
uri="https://vocabularies.cessda.eu/vocabulary/CountryNamesAndCodes?v=1.0.0"
where notation="CountryNamesAndCodes" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfTranslationMethod:1.0.0", 
citation="DDI Alliance. (2022). Type of Translation Method (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfTranslationMethod:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfTranslationMethod/1.0.0/" 
where notation="TypeOfTranslationMethod" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfFrequency:1.0.0", 
citation="DDI Alliance. (2023). Type of Frequency (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfFrequency:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfFrequency/1.0.0/" 
where notation="TypeOfFrequency" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfAddress:1.0.0", 
citation="DDI Alliance. (2020). Type of Address (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfAddress:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfAddress/1.0.0/" 
where notation="TypeOfAddress" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfNote:1.0.0", 
citation="DDI Alliance. (2020). Type of Note (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfNote:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfNote/1.0.0/" 
where notation="TypeOfNote" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:NumericType:1.0.0", 
citation="DDI Alliance. (2019). Numeric Type (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:NumericType:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/NumericType/1.0.0/" 
where notation="NumericType" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfAddress:1.1.0", 
citation="DDI Alliance. (2020). Type of Address (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfAddress:1.1.0.", 
number="1.1.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfAddress/1.1.0/" 
where notation="TypeOfAddress" and number='1.1';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfNote:1.1.0", 
citation="DDI Alliance. (2020). Type of Note (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfNote:1.1.0.", 
number="1.1.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfNote/1.1.0/" 
where notation="TypeOfNote" and number='1.1';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:NumericType:1.1.0", 
citation="DDI Alliance. (2019). Numeric Type (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:NumericType:1.1.0.", 
number="1.1.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/NumericType/1.1.0/" 
where notation="NumericType" and number='1.1';

SET SQL_SAFE_UPDATES = @SQL_SAFE_UPDATES;

Also I want to ask you to send me a logs from the SQL script, to identify another potential problems. As a database updates, must be solved with the system offline and really quickly I propose not to wait for the release. This is not a release, this is patching. If users will do something in the meantime, we will not be able to deliver good database patches. And why this is happening is because of two things. As the database was broken many years ago, there are still errors, and if we develop something new in good faith, that data are OK and they aren't, we are screwed and second, the big changes to the system, done on the fly and every time with all the consequences in the mind..

Joshocan commented 1 year ago

@pakoselo I modified the script a bit to disable foreign key check and re-enabled it after the required operations. That runs to completion with no errors. @MajaDolinar please you can test on dev and staging if issue is resolved.


SET SQL_SAFE_UPDATES = 0;
SET FOREIGN_KEY_CHECKS=0;

delete from concept where ((uri LIKE "%1.0.1%") and (
uri LIKE "%CharacterSet%" or 
uri like "%SoftwarePackage%" or
uri like "%TypeOfTelephone%" or
uri like "%TimeZone%" or
uri like "%CessdaPersistentIdentifierTypes%" or
uri like "%CountryNamesAndCodes%" or
uri like "%TypeOfTranslationMethod%" or
uri like "%TypeOfFrequency%"
));

delete from concept where ((uri LIKE "%1.1.1%") and (
uri LIKE "%NumericType%" or 
uri like "%TypeOfAddress%" or
uri like "%TypeOfNote%"));

DELETE FROM comment WHERE 
    version_id=672 or
    version_id=692 or
    version_id=693 or
    version_id=696 or
    version_id=697 or
    version_id=698 or
    version_id=699 or
    version_id=729 or
    version_id=731 or
    version_id=733 or
    version_id=734;

DELETE FROM version WHERE (
    (notation='CharacterSet' or 
    notation='SoftwarePackage' or 
    notation='TypeOfTelephone' or 
    notation='TimeZone' or 
    notation='CessdaPersistentIdentifierTypes' or 
    notation='CountryNamesAndCodes' or
    notation='TypeOfTranslationMethod' or
    notation='TypeOfFrequency' or
    notation='NumericType' or
    notation='TypeOfAddress' or
    notation='TypeOfNote') and version_notes LIKE "%To align%");

update vocabulary set version_number="1.0.0", version_en="1.0.0" where version_number="1.0.1";
update vocabulary set version_number="1.1.0", version_en="1.1.0" where version_number="1.1.1";
update vocabulary set uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfFrequency" where notation="TypeOfFrequency";
update vocabulary set status='PUBLISHED' where notation='CountryNamesAndCodes';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:CharacterSet:1.0.0", 
citation="DDI Alliance. (2020). Character Set (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:CharacterSet:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/CharacterSet/1.0.0/" 
where notation="CharacterSet" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:SoftwarePackage:1.0.0", 
citation="DDI Alliance. (2020). Software Package (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:SoftwarePackage:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/SoftwarePackage/1.0.0/" 
where notation="SoftwarePackage" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfTelephone:1.0.0", 
citation="DDI Alliance. (2020). Type of Telephone (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfTelephone:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfTelephone/1.0.0/" 
where notation="TypeOfTelephone" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TimeZone:1.0.0", 
citation="DDI Alliance. (2020). Time Zone (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TimeZone:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TimeZone/1.0.0/" 
where notation="TimeZone" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:CessdaPersistentIdentifierTypes:1.0.0", 
citation="CESSDA. (2020). CESSDA Persistent Identifier Types (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:CessdaPersistentIdentifierTypes:1.0.0.", 
number="1.0.0", 
uri="https://vocabularies.cessda.eu/vocabulary/CessdaPersistentIdentifierTypes?v=1.0.0" 
where notation="CessdaPersistentIdentifierTypes" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:CountryNamesAndCodes:1.0.0", 
citation="CESSDA. (2020). Country Names and Codes (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:CountryNamesAndCodes:1.0.0.", 
number="1.0.0", 
uri="https://vocabularies.cessda.eu/vocabulary/CountryNamesAndCodes?v=1.0.0"
where notation="CountryNamesAndCodes" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfTranslationMethod:1.0.0", 
citation="DDI Alliance. (2022). Type of Translation Method (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfTranslationMethod:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfTranslationMethod/1.0.0/" 
where notation="TypeOfTranslationMethod" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfFrequency:1.0.0", 
citation="DDI Alliance. (2023). Type of Frequency (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfFrequency:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfFrequency/1.0.0/" 
where notation="TypeOfFrequency" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfAddress:1.0.0", 
citation="DDI Alliance. (2020). Type of Address (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfAddress:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfAddress/1.0.0/" 
where notation="TypeOfAddress" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfNote:1.0.0", 
citation="DDI Alliance. (2020). Type of Note (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfNote:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfNote/1.0.0/" 
where notation="TypeOfNote" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:NumericType:1.0.0", 
citation="DDI Alliance. (2019). Numeric Type (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:NumericType:1.0.0.", 
number="1.0.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/NumericType/1.0.0/" 
where notation="NumericType" and number='1.0';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfAddress:1.1.0", 
citation="DDI Alliance. (2020). Type of Address (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfAddress:1.1.0.", 
number="1.1.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfAddress/1.1.0/" 
where notation="TypeOfAddress" and number='1.1';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:TypeOfNote:1.1.0", 
citation="DDI Alliance. (2020). Type of Note (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfNote:1.1.0.", 
number="1.1.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfNote/1.1.0/" 
where notation="TypeOfNote" and number='1.1';

update version set 
canonical_uri="urn:ddi:int.ddi.cv:NumericType:1.1.0", 
citation="DDI Alliance. (2019). Numeric Type (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:NumericType:1.1.0.", 
number="1.1.0", 
uri="http://rdf-vocabulary.ddialliance.org/cv/NumericType/1.1.0/" 
where notation="NumericType" and number='1.1';

SET SQL_SAFE_UPDATES = @SQL_SAFE_UPDATES;
SET FOREIGN_KEY_CHECKS=1;```
pakoselo commented 1 year ago

There must be the foreign key check, because we will leave residuals at the tables. It is better to remove everything which is not needed anymore. Can you please send me latest production database to be sure. Thanks

On Fri, Apr 28, 2023, 10:15 Joshocan @.***> wrote:

@pakoselo https://github.com/pakoselo I modified the script a bit to disable foreign key check and re-enabled it after the required operations. That runs to completion with no errors. @MajaDolinar https://github.com/MajaDolinar please you can test if issue is resolved.

`SET @SQL_SAFE_UPDATES=@@SQL_SAFE_UPDATES; SET SQL_SAFE_UPDATES = 0; SET FOREIGN_KEY_CHECKS=0;

delete from concept where ((uri LIKE "%1.0.1%") and ( uri LIKE "%CharacterSet%" or uri like "%SoftwarePackage%" or uri like "%TypeOfTelephone%" or uri like "%TimeZone%" or uri like "%CessdaPersistentIdentifierTypes%" or uri like "%CountryNamesAndCodes%" or uri like "%TypeOfTranslationMethod%" or uri like "%TypeOfFrequency%" ));

delete from concept where ((uri LIKE "%1.1.1%") and ( uri LIKE "%NumericType%" or uri like "%TypeOfAddress%" or uri like "%TypeOfNote%"));

DELETE FROM comment WHERE version_id=672 or version_id=692 or version_id=693 or version_id=696 or version_id=697 or version_id=698 or version_id=699 or version_id=729 or version_id=731 or version_id=733 or version_id=734;

DELETE FROM version WHERE ( (notation='CharacterSet' or notation='SoftwarePackage' or notation='TypeOfTelephone' or notation='TimeZone' or notation='CessdaPersistentIdentifierTypes' or notation='CountryNamesAndCodes' or notation='TypeOfTranslationMethod' or notation='TypeOfFrequency' or notation='NumericType' or notation='TypeOfAddress' or notation='TypeOfNote') and version_notes LIKE "%To align%");

update vocabulary set version_number="1.0.0", version_en="1.0.0" where version_number="1.0.1"; update vocabulary set version_number="1.1.0", version_en="1.1.0" where version_number="1.1.1"; update vocabulary set uri=" http://rdf-vocabulary.ddialliance.org/cv/TypeOfFrequency" where notation="TypeOfFrequency"; update vocabulary set status='PUBLISHED' where notation='CountryNamesAndCodes';

update version set canonical_uri="urn:ddi:int.ddi.cv:CharacterSet:1.0.0", citation="DDI Alliance. (2020). Character Set (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:CharacterSet:1.0.0.", number="1.0.0", uri="http://rdf-vocabulary.ddialliance.org/cv/CharacterSet/1.0.0/" where notation="CharacterSet" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:SoftwarePackage:1.0.0", citation="DDI Alliance. (2020). Software Package (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv: SoftwarePackage:1.0.0.", number="1.0.0", uri="http://rdf-vocabulary.ddialliance.org/cv/SoftwarePackage/1.0.0/" where notation="SoftwarePackage" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:TypeOfTelephone:1.0.0", citation="DDI Alliance. (2020). Type of Telephone (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv: TypeOfTelephone:1.0.0.", number="1.0.0", uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfTelephone/1.0.0/" where notation="TypeOfTelephone" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:TimeZone:1.0.0", citation="DDI Alliance. (2020). Time Zone (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TimeZone:1.0.0.", number="1.0.0", uri="http://rdf-vocabulary.ddialliance.org/cv/TimeZone/1.0.0/" where notation="TimeZone" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:CessdaPersistentIdentifierTypes:1.0.0", citation="CESSDA. (2020). CESSDA Persistent Identifier Types (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv: CessdaPersistentIdentifierTypes:1.0.0.", number="1.0.0", uri=" https://vocabularies.cessda.eu/vocabulary/CessdaPersistentIdentifierTypes?v=1.0.0 " where notation="CessdaPersistentIdentifierTypes" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:CountryNamesAndCodes:1.0.0", citation="CESSDA. (2020). Country Names and Codes (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv: CountryNamesAndCodes:1.0.0.", number="1.0.0", uri=" https://vocabularies.cessda.eu/vocabulary/CountryNamesAndCodes?v=1.0.0" where notation="CountryNamesAndCodes" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:TypeOfTranslationMethod:1.0.0", citation="DDI Alliance. (2022). Type of Translation Method (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv: TypeOfTranslationMethod:1.0.0.", number="1.0.0", uri=" http://rdf-vocabulary.ddialliance.org/cv/TypeOfTranslationMethod/1.0.0/" where notation="TypeOfTranslationMethod" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:TypeOfFrequency:1.0.0", citation="DDI Alliance. (2023). Type of Frequency (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv: TypeOfFrequency:1.0.0.", number="1.0.0", uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfFrequency/1.0.0/" where notation="TypeOfFrequency" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:TypeOfAddress:1.0.0", citation="DDI Alliance. (2020). Type of Address (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfAddress:1.0.0.", number="1.0.0", uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfAddress/1.0.0/" where notation="TypeOfAddress" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:TypeOfNote:1.0.0", citation="DDI Alliance. (2020). Type of Note (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfNote:1.0.0.", number="1.0.0", uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfNote/1.0.0/" where notation="TypeOfNote" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:NumericType:1.0.0", citation="DDI Alliance. (2019). Numeric Type (Version 1.0.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:NumericType:1.0.0.", number="1.0.0", uri="http://rdf-vocabulary.ddialliance.org/cv/NumericType/1.0.0/" where notation="NumericType" and number='1.0';

update version set canonical_uri="urn:ddi:int.ddi.cv:TypeOfAddress:1.1.0", citation="DDI Alliance. (2020). Type of Address (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfAddress:1.1.0.", number="1.1.0", uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfAddress/1.1.0/" where notation="TypeOfAddress" and number='1.1';

update version set canonical_uri="urn:ddi:int.ddi.cv:TypeOfNote:1.1.0", citation="DDI Alliance. (2020). Type of Note (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:TypeOfNote:1.1.0.", number="1.1.0", uri="http://rdf-vocabulary.ddialliance.org/cv/TypeOfNote/1.1.0/" where notation="TypeOfNote" and number='1.1';

update version set canonical_uri="urn:ddi:int.ddi.cv:NumericType:1.1.0", citation="DDI Alliance. (2019). Numeric Type (Version 1.1.0) [Controlled vocabulary]. CESSDA. urn:ddi:int.ddi.cv:NumericType:1.1.0.", number="1.1.0", uri="http://rdf-vocabulary.ddialliance.org/cv/NumericType/1.1.0/" where notation="NumericType" and number='1.1';

SET SQL_SAFE_UPDATES = @SQL_SAFE_UPDATES; SET FOREIGN_KEY_CHECKS=1;`

— Reply to this email directly, view it on GitHub https://github.com/cessda/cessda.cvs.two/issues/607#issuecomment-1527169230, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB23PTT56XGG2URSY6N66LLXDN4A7ANCNFSM6AAAAAAXDWLAZM . You are receiving this because you were mentioned.Message ID: @.***>

Joshocan commented 1 year ago

@pakoselo production db sent to you. Note that the production db is not yet patched.

pakoselo commented 1 year ago

@Joshocan It works for me. Also the error itself doesn't make sense. It looks to me, like there is a clash of dev and production database. Did you override the dev DB with production one? The error itself shouldn't be showed and also there is urn, which doesn't exist in the production DB. Can you please try once again? Use the second script, which is more robust, but the first one, should be also enough to process production DB.

Joshocan commented 1 year ago

@pakoselo the script is run successful. You can test the functionality in dev and staging.

MajaDolinar commented 1 year ago

I tested on staging and it looks great. I did find another vocabulary though that would need this change as well, this is: https://vocabularies-staging.cessda.eu/vocabulary/CdcPublisherNames?lang=en It should be 5.0.0

The only issue remaining that is connected to this issue is the versioning number in results list - it still shows the wrong versions 1.0.1 etc. See: https://vocabularies-staging.cessda.eu/?page=1

Please change the version numbers also there

pakoselo commented 1 year ago

@MajaDolinar It only needs to rebuild the index. I did it. It should show the right numbers. What I didn't get is why the urn and citation links are still showing 1.0 and not 1.0.0 as I also update them? Are you sure @Joshocan , there were no errors, or some of the updates show 0 changed lines? I will prepare the script also for the https://vocabularies-staging.cessda.eu/vocabulary/CdcPublisherNames?lang=en.

Joshocan commented 1 year ago

@pakoselo Yes, I re-run the script on staging there were no errors. Also re-indexed the staging instance. Do you want a copy of staging DB?

pakoselo commented 1 year ago

@Joshocan yes please. It doesn't look good on staging.

Joshocan commented 1 year ago

@pakoselo Sent you a copy of staging DB.

MajaDolinar commented 1 year ago

Looks good now also for CDC publisher names. The only issue remains the homepage view - probably it would need another index rebuild, since it now shows 5.0.1 and not 6.0.0

pakoselo commented 1 year ago

@MajaDolinar I wasn't working on the CDC publisher names 5.0.1 yet, because there is still not a good version of DB at the staging. I had a discussion with @Joshocan about that, but still it's not there. Because the script wasn't actually 100% successful. The licenses and URI(s)/URN(s) aren't corrected. My idea was to redeploy the production DB to the staging or dev (I prefer dev as you can see later) environment to have test there. I think, the dev environment should be accessible only by developers and few testers, so we don't care about the changes there. @john-shepherdson @Joshua-cessda-admin @MajaDolinar I think the dev environment should be accessible also for us (evelopers, @pakoselo and @Stifo ), because it takes too much time to change there something. I mean access to the shell and command line to change things directly in DB and so on. Right now I am still waiting for @Joshocan to redeploy production DB. The script doesn't work for 100% on that database, because it is probably ahead comparing to production one.

MajaDolinar commented 1 year ago

Yes I understand, please push this forward. Since we are not finished with this yet, I am moving the release of 3.2.0 to May 23 (since next Tuesday I need the service to be accessible). Please resolve this by then.

Joshocan commented 1 year ago

@pakoselo My apologies. Production DB has been deployed to staging and script run successful. @MajaDolinar No need to postpone release if can be confirm that issue is resolved.

MajaDolinar commented 1 year ago

@Joshocan ok, by when do you need the approval of the release in order to have it today?

@pakoselo let me know, when it will be fixed, so that I can check

Joshocan commented 1 year ago

@MajaDolinar As soon as you can confirm that all issues related to the release are resolved.

Joshocan commented 1 year ago

@pakoselo please can you confirm if the issue is fixed on staging?

pakoselo commented 1 year ago

@Joshocan @MajaDolinar except the CDC publisher names. it looks quite good. Actually somebody add new version of CDC publisher names, which is correctly identified as 6.0.0. 5.0.1 is of course still shown in the versions history. My question to @Joshocan is why we don't have it also in the staging environment?

pakoselo commented 1 year ago

@Joshocan can you please provide latest production DB, please? The staging DB and production aren't aligned. As there is already 6.0.0 in the production, I am proposing to remove 5.0.1 as a mistake and the problem with this version will vanish. I just need to test if there aren't residuals or something left in the DB. Also to rewrite previous versions in the version table.

pakoselo commented 1 year ago

@MajaDolinar I propose not to deal with that vocabulary, as there will be lot of changes, because there already exist the 6.0.0, which predecessor was 5.0.1. Lot of tables are aligned together, so the change will be really hard to code. It is possible, but if there is already the 6.0.0, I think we can leave it as it is. If not, I can work on that, but it will require more time comparing to first script. Also I hope that there were no changes (new versions) in the first 11 vocabularies, because then the script will not work at all. I go quickly through them, and it looks ok. So the script should work.

MajaDolinar commented 1 year ago

Yes, I think it will be ok. Anyway this is a CESSDA vocabulary and not DDI so DDI should not have any issues with it, and I don't believe that anyone from CESSDA is going to have an issue with this anyway. I propose to close this issue and leave this one as 6.0.0 (which is already on production). Be sure to only reindex the homepage to show the latest versions everywhere. I am 99,9% sure that no changes were made to the DDI CVs, so we should be good implementing this on production. I am closing this issue now.

MajaDolinar commented 1 year ago

@Joshua-cessda-admin I have checked on production and the index for the homepage needs a rebuild as well. It shows wrong versions for these CVs: https://vocabularies.cessda.eu/?page=1

IT shows the wrong versions on homepage for all these CVs: https://vocabularies.cessda.eu/vocabulary/CessdaPersistentIdentifierTypes?lang=en https://vocabularies.cessda.eu/vocabulary/CharacterSet?lang=en https://vocabularies.cessda.eu/vocabulary/CountryNamesAndCodes?lang=en https://vocabularies.cessda.eu/vocabulary/NumericType?lang=en https://vocabularies.cessda.eu/vocabulary/SoftwarePackage?lang=en https://vocabularies.cessda.eu/vocabulary/TimeZone?lang=en https://vocabularies.cessda.eu/vocabulary/TypeOfAddress?lang=en https://vocabularies.cessda.eu/vocabulary/TypeOfFrequency?lang=en https://vocabularies.cessda.eu/vocabulary/TypeOfNote?lang=en https://vocabularies.cessda.eu/vocabulary/TypeOfTelephone?lang=en https://vocabularies.cessda.eu/vocabulary/TypeOfTranslationMethod?lang=en

Joshocan commented 1 year ago

@MajaDolinar I have re-indexed. Check if it appears expected.

@pakoselo We noted your concern about access to dev/staging instances. We will discuss it internally and get back to you on that.

MajaDolinar commented 1 year ago

Yes, it appears fine now on production. Closing this issue.

pakoselo commented 1 year ago

@MajaDolinar I will not reopen the issue, but there is one possibility how-to solve this problem. We can delete the 6.0.0 and 5.0.1 versions and recreate the 6.0.0 once again (there is only one small change in code deprecation). If you want. But probably first it will be good to test it on staging/dev or locally on my own environment, but I need the latest production DB. Another CV I found with really strange versions is this one: https://vocabularies.cessda.eu/vocabulary/KategorienschemaWahlstudien. Probably it should be originally in German, but the English was ahead so it was aligned as 1.0.2, but if we follow the new versioning paradigm, probably it should be 1.1.0. What do you think Maja?

MajaDolinar commented 1 year ago

OK, please test for the first one and we will see later.

For the second: yes I have seen this one from Gesis as well and was trying to understand what happened to it. I will need to ask Gesis what the SL in this case is for them: German or English. I understood German, so the English should be translation. But I will see with them what their workflow in entering this vocabulary was. RIght now I agree that the versioning here is wrong. I will create another issue for this for the next version.

pakoselo commented 1 year ago

First: @MajaDolinar Ok, I will test it. @Joshocan can you please provide me the latest production DB? Thanks. Second: I will wait.

pakoselo commented 1 year ago

@MajaDolinar There is one functionality, which prevents the mentioned workflow to solve the issue (actually it breaks whole DB). If you want to delete a SL vocabulary (let's say 5.0.1, which shouldn't exist at all, but unfortunately it's there), it will delete every SL/TL with the 5.0.x versions. So actually it removes also the previous Sl version, which leads to the inconsistent state of the DB. Please do not try on the production. But I have a solution. We will change the version of the 5.0.1 to 5.1.0. This will align with the idea of the 3 digit versioning, and also the proposed workflow can be later applied. Actually this will be much more simpler hack. Also it can stay with the 5.1.0 version in the system, if you want. At least it will be aligned with the 3 digit versioning.

Joshocan commented 1 year ago

@MajaDolinar should this issue be reopened or create a new one. @pakoselo @Stifo We have agreed to grant you access to development an staging environments. You will receive notification on that soon.

MajaDolinar commented 1 year ago

It is better to create a new one, since this one was already released and the issue here concerns only one CESSDA vocabulary. @Joshocan could you please create a new issue? I am hosting a webinar now and am not able to do it right away.

Joshocan commented 1 year ago

@MajaDolinar Issue #655 created.

Joshocan commented 1 year ago

@pakoselo @Stifo Please can you privately send me your google account for the access to the environments.