Revision 7aae56da
Added by Andreas Müller about 3 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v523_525/CollectorTitleUpdater.java | ||
---|---|---|
55 | 55 |
String sql = "UPDATE @@AgentBase@@ SET collectorTitleCache = titleCache WHERE DTYPE = 'Person' OR DTYPE = 'Team'"; |
56 | 56 |
datasource.executeUpdate(caseType.replaceTableNames(sql)); |
57 | 57 |
|
58 |
//to remove changes previously made in SchemaUpdater_5230_5250 before handlePerson() was adapted |
|
59 |
sql = "UPDATE @@AgentBase@@ SET collectorTitle = NULL WHERE DTYPE = 'Person'"; |
|
60 |
datasource.executeUpdate(caseType.replaceTableNames(sql)); |
|
61 |
|
|
58 | 62 |
//for teams being part of gathering event |
59 | 63 |
sql = " SELECT ab.* FROM @@AgentBase@@ ab WHERE id IN (SELECT actor_id FROM @@GatheringEvent@@) "; |
60 | 64 |
ResultSet rs = datasource.executeQuery(caseType.replaceTableNames(sql)); |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v523_525/SchemaUpdater_5230_5250.java | ||
---|---|---|
58 | 58 |
int length = 800; |
59 | 59 |
ColumnAdder.NewStringInstance(stepList, stepName, tableName, newColumnName, length, INCLUDE_AUDIT); |
60 | 60 |
|
61 |
CollectorTitleUpdater.NewInstance(stepList);
|
|
61 |
// CollectorTitleUpdater.NewInstance(stepList); => moved to SchemaUpdater_5250_5251
|
|
62 | 62 |
|
63 | 63 |
//#9664 #4311 |
64 | 64 |
stepName = "Add nomenclaturalTitleCache to AgentBase"; |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v523_525/SchemaUpdater_5250_5251.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2007 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.cdm.database.update.v523_525; |
|
10 |
|
|
11 |
import java.util.ArrayList; |
|
12 |
import java.util.List; |
|
13 |
|
|
14 |
import org.apache.log4j.Logger; |
|
15 |
|
|
16 |
import eu.etaxonomy.cdm.database.update.ISchemaUpdater; |
|
17 |
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep; |
|
18 |
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase; |
|
19 |
import eu.etaxonomy.cdm.database.update.v522_523.SchemaUpdater_5220_5230; |
|
20 |
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.CdmVersion; |
|
21 |
|
|
22 |
/** |
|
23 |
* @author a.mueller |
|
24 |
* @date 22.04.2021 |
|
25 |
*/ |
|
26 |
public class SchemaUpdater_5250_5251 extends SchemaUpdaterBase { |
|
27 |
|
|
28 |
@SuppressWarnings("unused") |
|
29 |
private static final Logger logger = Logger.getLogger(SchemaUpdater_5250_5251.class); |
|
30 |
|
|
31 |
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_25_00; |
|
32 |
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_25_01; |
|
33 |
|
|
34 |
// ********************** FACTORY METHOD ************************************* |
|
35 |
|
|
36 |
public static SchemaUpdater_5250_5251 NewInstance() { |
|
37 |
return new SchemaUpdater_5250_5251(); |
|
38 |
} |
|
39 |
|
|
40 |
protected SchemaUpdater_5250_5251() { |
|
41 |
super(startSchemaVersion.versionString(), endSchemaVersion.versionString()); |
|
42 |
} |
|
43 |
|
|
44 |
@Override |
|
45 |
protected List<ISchemaUpdaterStep> getUpdaterList() { |
|
46 |
|
|
47 |
String stepName; |
|
48 |
String tableName; |
|
49 |
String newColumnName; |
|
50 |
|
|
51 |
List<ISchemaUpdaterStep> stepList = new ArrayList<>(); |
|
52 |
|
|
53 |
CollectorTitleUpdater.NewInstance(stepList); |
|
54 |
|
|
55 |
return stepList; |
|
56 |
} |
|
57 |
|
|
58 |
@Override |
|
59 |
public ISchemaUpdater getPreviousUpdater() { |
|
60 |
return SchemaUpdater_5220_5230.NewInstance(); |
|
61 |
} |
|
62 |
} |
Also available in: Unified diff
ref #4311 move update script for collector title to 5.25.1