Project

General

Profile

bug #7177

Fix protectedTitleCache for Agents which have no data except the cache

Added by Andreas Kohlbecker almost 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Highest
Category:
-
Target version:
-
Start date:
01/15/2018
Due date:
% Done:

100%

Tags:

Description

This is important for the phycobank playday

History

#1 Updated by Andreas Müller over 2 years ago

  • Target version changed from Release 4.13 to Release 4.14

#2 Updated by Andreas Kohlbecker over 2 years ago

  • Status changed from New to Resolved
  • Target version changed from Release 4.14 to Release 4.13

already solved in the production data?

#3 Updated by Andreas Kohlbecker over 2 years ago

  • % Done changed from 0 to 50

#4 Updated by Andreas Kohlbecker over 2 years ago

sql to test


select * from AgentBase a 
    where DTYPE = 'Person'
        and a.lastname is null AND a.firstname is null AND a.initials is NULL 
        AND (a.protectedTitleCache = 0 OR a.protectedCollectorTitleCache  = 0 OR a.protectedNomenclaturalTitleCache = 0)

select * from AgentBase a left join AgentBase_AgentBase a_a on a_a.Team_id = a.id
    where DTYPE = 'Team'
        and a_a.Team_id is null
        AND (a.protectedTitleCache = 0 OR a.protectedCollectorTitleCache  = 0 OR a.protectedNomenclaturalTitleCache = 0)

#5 Updated by Andreas Kohlbecker over 2 years ago

and the query to fix the data:

UPDATE AgentBase a left join AgentBase_AgentBase a_a on a_a.Team_id = a.id
    SET a.protectedTitleCache = 1, a.protectedCollectorTitleCache  = 1, a.protectedNomenclaturalTitleCache = 1
 WHERE 
    DTYPE = 'Team'
    AND a_a.Team_id is null
    AND (a.protectedTitleCache = 0 OR a.protectedCollectorTitleCache  = 0 OR a.protectedNomenclaturalTitleCache = 0)

UPDATE AgentBase a left join AgentBase_AgentBase a_a on a_a.Team_id = a.id
    SET a.protectedTitleCache = 1, a.protectedCollectorTitleCache  = 1, a.protectedNomenclaturalTitleCache = 1
 WHERE 
    DTYPE = 'Person'
    and a.lastname is null AND a.firstname is null AND a.initials is NULL 
    AND (a.protectedTitleCache = 0 OR a.protectedCollectorTitleCache  = 0 OR a.protectedNomenclaturalTitleCache = 0)

#6 Updated by Andreas Kohlbecker over 2 years ago

applied to all databases!

#7 Updated by Andreas Kohlbecker over 2 years ago

  • Tags set to phycobank
  • Status changed from Resolved to Closed
  • % Done changed from 50 to 100

#8 Updated by Andreas Kohlbecker over 2 years ago

  • Project changed from Edit to PhycoBank
  • Category deleted (data)
  • Target version deleted (Release 4.13)

#9 Updated by Andreas Kohlbecker over 1 year ago

  • Subject changed from Fix protectedTitleCache for Agents wich have no data except the cache to Fix protectedTitleCache for Agents which have no data except the cache

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)