Inactive enumvalue fix: Difference between revisions

From IMSMA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
The upgrade scripts set '''wrongly''' some of the existing enumvalues to '''Inactive'''. (Looking better with 11 Nov build need to be verified with more databases)
The upgrade scripts set '''wrongly''' some of the existing enumvalues to '''Inactive'''. (Tested with 18 Feb 2015 build and problem is still there)


Compare the result of this query with the export you did before the upgrade.
Compare the result of this query with the export you did before the upgrade.
Line 15: Line 15:
"public".imsmaenum
"public".imsmaenum
WHERE
WHERE
("public".imsmaenum.enumcategory = 'Mine Action Activity' OR
"public".imsmaenum.enumcategory = 'RecommendationType' OR
"public".imsmaenum.enumcategory = 'Worksite' OR
"public".imsmaenum.enumcategory = 'Theme Type') AND
"public".imsmaenum.isactive = 'f'
"public".imsmaenum.isactive = 'f'
ORDER BY
ORDER BY
Line 30: Line 26:
# Set ''isactive'' to t (TRUE) if the country had them as Active in 5.08.04  
# Set ''isactive'' to t (TRUE) if the country had them as Active in 5.08.04  
# Repeat 3 - 4 until all are done and run the query again as double-check of number of Inactive.  
# Repeat 3 - 4 until all are done and run the query again as double-check of number of Inactive.  
'''Quick fix'''<br/>
If all inactive imsmaenums are in the four categories ''Mine Action Activity'', ''RecommendationType'', ''Worksite'' or ''Theme Type'' then this UPDATE query fix it.
<pre>
UPDATE imsmaenum
SET
isactive ='t'
WHERE
(enumcategory = 'Mine Action Activity' OR
enumcategory = 'RecommendationType' OR
enumcategory = 'Theme Type' OR
enumcategory = 'Worksite') AND
isactive = 'f'
</pre>


{{NavBox Upgrade}}
{{NavBox Upgrade}}

Latest revision as of 22:12, 12 April 2015

The upgrade scripts set wrongly some of the existing enumvalues to Inactive. (Tested with 18 Feb 2015 build and problem is still there)

Compare the result of this query with the export you did before the upgrade.

SELECT DISTINCT
"public".imsmaenum.imsmaenum_guid,
"public".imsmaenum.enumcategory,
"public".imsmaenum.enumvalue,
"public".imsmaenum.widgettype,
"public".imsmaenum.seqno,
"public".imsmaenum.dataentrydate,
"public".imsmaenum.dataenterer,
"public".imsmaenum.isactive
FROM
"public".imsmaenum
WHERE
"public".imsmaenum.isactive = 'f'
ORDER BY
"public".imsmaenum.enumcategory ASC,
"public".imsmaenum.enumvalue ASC
  1. If you now have more values that are Inactive than before upgrade, you need do the steps below until you have equally many Inactive (mandatory)
  2. Open table imsmaenum with Navicat and sort on enumcategory
  3. Compare the result set from before the upgrade scripts with current records
  4. Set isactive to t (TRUE) if the country had them as Active in 5.08.04
  5. Repeat 3 - 4 until all are done and run the query again as double-check of number of Inactive.

Quick fix
If all inactive imsmaenums are in the four categories Mine Action Activity, RecommendationType, Worksite or Theme Type then this UPDATE query fix it.

UPDATE imsmaenum
SET
isactive ='t'
WHERE
(enumcategory = 'Mine Action Activity' OR
enumcategory = 'RecommendationType' OR
enumcategory = 'Theme Type' OR
enumcategory = 'Worksite') AND
isactive = 'f'

{{#switch:|subgroup|child=|none=|#default=

}}{{#if:|}}{{#if:Upgrade Process|<td style="text-align:left;border-left-width:2px;border-left-style:solid;|{{#if:|}}}}{{#if:|{{#if:IMSMA Hub{{#switch:{{#if:|{{{border}}}|child}}|subgroup|child=|none=|#default=

}}{{#ifeq:|Template|{{#ifeq:{{#if:|{{{border}}}|child}}|child||{{#ifeq:{{#if:|{{{border}}}|child}}|subgroup||{{#switch:inactive enumvalue fix

|doc
|sandbox
|testcases =
|#default = {{#switch:
 |plainlist
 |hlist
 |hlist hnum
 |hlist vcard
 |vcard hlist = 
 |#default = 
 }}
}}

}}}}}}|}}{{#if:|{{{group2}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list2}}}

}}{{#if:|{{#if:IMSMA Hub{{#switch:{{#if:|{{{border}}}|child}}|subgroup|child=|none=|#default=

}}{{#ifeq:|Template|{{#ifeq:{{#if:|{{{border}}}|child}}|child||{{#ifeq:{{#if:|{{{border}}}|child}}|subgroup||{{#switch:inactive enumvalue fix

|doc
|sandbox
|testcases =
|#default = {{#switch:
 |plainlist
 |hlist
 |hlist hnum
 |hlist vcard
 |vcard hlist = 
 |#default = 
 }}
}}

}}}}}}|}}{{#if:|{{{group3}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list3}}}

}}{{#if:|{{#if:|{{{group4}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list4}}}

}}{{#if:|{{#if:|{{{group5}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list5}}}

}}{{#if:|{{#if:|{{{group6}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list6}}}

}}{{#if:|{{#if:|{{{group7}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list7}}}

}}{{#if:|{{#if:|{{{group8}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list8}}}

}}{{#if:|{{#if:|{{{group9}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list9}}}

}}{{#if:|{{#if:|{{{group10}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list10}}}

}}{{#if:|{{#if:|{{{group11}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list11}}}

}}{{#if:|{{#if:|{{{group12}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list12}}}

}}{{#if:|{{#if:|{{{group13}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list13}}}

}}{{#if:|{{#if:|{{{group14}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list14}}}

}}{{#if:|{{#if:|{{{group15}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list15}}}

}}{{#if:|{{#if:|{{{group16}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list16}}}

}}{{#if:|{{#if:|{{{group17}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list17}}}

}}{{#if:|{{#if:|{{{group18}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list18}}}

}}{{#if:|{{#if:|{{{group19}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list19}}}

}}{{#if:|{{#if:|{{{group20}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list20}}}

}}{{#if:|{{#if:IMSMA Hub{{#switch:{{#if:|{{{border}}}|child}}|subgroup|child=|none=|#default=

}}{{#ifeq:|Template|{{#ifeq:{{#if:|{{{border}}}|child}}|child||{{#ifeq:{{#if:|{{{border}}}|child}}|subgroup||{{#switch:inactive enumvalue fix

|doc
|sandbox
|testcases =
|#default = {{#switch:
 |plainlist
 |hlist
 |hlist hnum
 |hlist vcard
 |vcard hlist = 
 |#default = 
 }}
}}

}}}}}}|}}

{{{below}}}

}}{{#switch:|subgroup|child=

|none=|#default=}}{{#ifeq:|Template|{{#ifeq:|child||{{#ifeq:|subgroup||{{#switch:inactive enumvalue fix
|doc
|sandbox
|testcases =
|#default = {{#switch:hlist
 |plainlist
 |hlist
 |hlist hnum
 |hlist vcard
 |vcard hlist = 
 |#default = 
 }}
}}

}}}}}}