Looking for some additional feedback on longer terms solutions. Brady commented on github but figured I should ask here as well.
Summary: I discovered during several 3.x to 4.0 upgrades that not wrapping every language insert resulted in fails because (horrors) the user had already created some languages and ethrace records…
I am looking for advice on how the current upgrade scripts can handle (or if they should handle) renumbering the elements that already exist the way we did for english and spanish.
Interesting issue, especially considering we made it so easy to add these categories with the ajax add button… This is probably why Rod didn’t include the list of states in the upgrade script. You’re above script will at least not break, but still risky potential to add redundant title categories, which could cause a hybrid database for the same “entry”. Could be time for you to join the sql_upgrade.php development darkside and make a new IfNotRow2Dx2 function in sql_upgrade.php:
IfNotRow2Dx2 list_options list_id ethrace option_id withheld title Withheld
(function would basically run through #IfNotRow2D twice with parameter 1 and 2, and then parameter 1 and 3) This would then ensure not adding a list item if the option_id or title already exist.)
I would not worry about the ordering (seq). User can easily fix this.
Traveling this week, not sure that’s something I want to take on, in any case. It whole concept of a meta-language buried in an SQL file just feels wrong to me, somehow. There has to be a better way to manage SQL upgrades, though, I confess, I can’t think of one right now.
Tony, note this kind of stuff would never be possible without a meta-language. Above should avoid duplicates in list items. I wouldn’t worry about the seq (ordering), since you can’t predict this and it is only cosmetic.