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.ColumnAdder;
|
17
|
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
|
18
|
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
|
19
|
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
|
20
|
import eu.etaxonomy.cdm.database.update.TableCreator;
|
21
|
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.CdmVersion;
|
22
|
|
23
|
/**
|
24
|
* @author a.mueller
|
25
|
* @date 22.04.2021
|
26
|
*/
|
27
|
public class SchemaUpdater_5250_5251 extends SchemaUpdaterBase {
|
28
|
|
29
|
@SuppressWarnings("unused")
|
30
|
private static final Logger logger = Logger.getLogger(SchemaUpdater_5250_5251.class);
|
31
|
|
32
|
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_25_00;
|
33
|
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_25_01;
|
34
|
|
35
|
// ********************** FACTORY METHOD *************************************
|
36
|
|
37
|
public static SchemaUpdater_5250_5251 NewInstance() {
|
38
|
return new SchemaUpdater_5250_5251();
|
39
|
}
|
40
|
|
41
|
protected SchemaUpdater_5250_5251() {
|
42
|
super(startSchemaVersion.versionString(), endSchemaVersion.versionString());
|
43
|
}
|
44
|
|
45
|
@Override
|
46
|
protected List<ISchemaUpdaterStep> getUpdaterList() {
|
47
|
|
48
|
String stepName;
|
49
|
String tableName;
|
50
|
String newColumnName;
|
51
|
|
52
|
List<ISchemaUpdaterStep> stepList = new ArrayList<>();
|
53
|
|
54
|
//#4311
|
55
|
CollectorTitleUpdater.NewInstance(stepList);
|
56
|
|
57
|
//#9692 add TaxonomicOperation table
|
58
|
stepName = "Add TaxonomicOperation table";
|
59
|
tableName = "TaxonomicOperation";
|
60
|
String[] columnNames = new String[]{"type","timeperiod_start", "timeperiod_end", "timeperiod_freetext"};
|
61
|
String[] columnTypes = new String[]{"string_20","string_255","string_255","string_255"};
|
62
|
String[] referencedTables = new String[]{null, null, null, null};
|
63
|
TableCreator.NewVersionableInstance(stepList, stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT);
|
64
|
|
65
|
//#9692 add operation to taxon relationship
|
66
|
stepName = "Add operation to taxon relationship";
|
67
|
tableName = "TaxonRelationship";
|
68
|
newColumnName = "operation_id";
|
69
|
String referencedTable = "TaxonomicOperation";
|
70
|
ColumnAdder.NewIntegerInstance(stepList, stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
|
71
|
|
72
|
return stepList;
|
73
|
}
|
74
|
|
75
|
@Override
|
76
|
public ISchemaUpdater getPreviousUpdater() {
|
77
|
return SchemaUpdater_5230_5250.NewInstance();
|
78
|
}
|
79
|
}
|