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
|
|
10
|
package eu.etaxonomy.cdm.database.update.v511_512;
|
11
|
|
12
|
import java.util.ArrayList;
|
13
|
import java.util.List;
|
14
|
|
15
|
import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
|
16
|
|
17
|
import eu.etaxonomy.cdm.database.update.ColumnTypeChanger;
|
18
|
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
|
19
|
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
|
20
|
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
|
21
|
import eu.etaxonomy.cdm.database.update.TableDropper;
|
22
|
import eu.etaxonomy.cdm.database.update.v508_511.SchemaUpdater_5111_5112;
|
23
|
|
24
|
/**
|
25
|
* @author a.mueller
|
26
|
* @date 02.12.2019
|
27
|
*/
|
28
|
public class SchemaUpdater_5112_5120 extends SchemaUpdaterBase {
|
29
|
|
30
|
@SuppressWarnings("unused")
|
31
|
private static final Logger logger = LogManager.getLogger(SchemaUpdater_5112_5120.class);
|
32
|
|
33
|
private static final String endSchemaVersion = "5.12.0.0.20191202";
|
34
|
private static final String startSchemaVersion = "5.11.2.0.20191109";
|
35
|
|
36
|
// ********************** FACTORY METHOD *************************************
|
37
|
|
38
|
public static SchemaUpdater_5112_5120 NewInstance() {
|
39
|
return new SchemaUpdater_5112_5120();
|
40
|
}
|
41
|
|
42
|
protected SchemaUpdater_5112_5120() {
|
43
|
super(startSchemaVersion, endSchemaVersion);
|
44
|
}
|
45
|
|
46
|
@Override
|
47
|
protected List<ISchemaUpdaterStep> getUpdaterList() {
|
48
|
|
49
|
String stepName;
|
50
|
String tableName;
|
51
|
String columnName;
|
52
|
|
53
|
List<ISchemaUpdaterStep> stepList = new ArrayList<>();
|
54
|
|
55
|
//#8738 Allow NULL on CdmLink.startPos
|
56
|
stepName = "Allow NULL on CdmLink.startPos";
|
57
|
tableName = "CdmLink";
|
58
|
columnName = "startPos";
|
59
|
ColumnTypeChanger.NewChangeAllowNullOnIntChanger(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
|
60
|
|
61
|
//#8738 Allow NULL on CdmLink.endPos
|
62
|
stepName = "Allow NULL on CdmLink.endPos";
|
63
|
tableName = "CdmLink";
|
64
|
columnName = "endPos";
|
65
|
ColumnTypeChanger.NewChangeAllowNullOnIntChanger(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
|
66
|
|
67
|
//#8702 Allow NULL on uuid on AUD tables
|
68
|
stepName = "Allow NULL on uuid on AmplificationResult_AUD tables";
|
69
|
tableName = "AmplificationResult_AUD";
|
70
|
columnName = "uuid";
|
71
|
ColumnTypeChanger.NewChangeAllowNullOnStringChanger(stepList, stepName, tableName, columnName, 36, !INCLUDE_AUDIT);
|
72
|
|
73
|
stepName = "Allow NULL on uuid on CdmLink_AUD table";
|
74
|
tableName = "CdmLink_AUD";
|
75
|
columnName = "uuid";
|
76
|
ColumnTypeChanger.NewChangeAllowNullOnStringChanger(stepList, stepName, tableName, columnName, 36, !INCLUDE_AUDIT);
|
77
|
|
78
|
stepName = "Allow NULL on uuid on DnaQuality_AUD table";
|
79
|
tableName = "DnaQuality_AUD";
|
80
|
columnName = "uuid";
|
81
|
ColumnTypeChanger.NewChangeAllowNullOnStringChanger(stepList, stepName, tableName, columnName, 36, !INCLUDE_AUDIT);
|
82
|
|
83
|
stepName = "Allow NULL on uuid on Identifier_AUD table";
|
84
|
tableName = "Identifier_AUD";
|
85
|
columnName = "uuid";
|
86
|
ColumnTypeChanger.NewChangeAllowNullOnStringChanger(stepList, stepName, tableName, columnName, 36, !INCLUDE_AUDIT);
|
87
|
|
88
|
stepName = "Allow NULL on uuid on Registration_AUD table";
|
89
|
tableName = "Registration_AUD";
|
90
|
columnName = "uuid";
|
91
|
ColumnTypeChanger.NewChangeAllowNullOnStringChanger(stepList, stepName, tableName, columnName, 36, !INCLUDE_AUDIT);
|
92
|
|
93
|
stepName = "Allow NULL on uuid on SingleReadAlignment_AUD table";
|
94
|
tableName = "SingleReadAlignment_AUD";
|
95
|
columnName = "uuid";
|
96
|
ColumnTypeChanger.NewChangeAllowNullOnStringChanger(stepList, stepName, tableName, columnName, 36, !INCLUDE_AUDIT);
|
97
|
|
98
|
stepName = "Allow NULL on uuid on TaxonNodeAgentRelation_AUD table";
|
99
|
tableName = "TaxonNodeAgentRelation_AUD";
|
100
|
columnName = "uuid";
|
101
|
ColumnTypeChanger.NewChangeAllowNullOnStringChanger(stepList, stepName, tableName, columnName, 36, !INCLUDE_AUDIT);
|
102
|
|
103
|
//#8468 remove old inapplicableIf tables
|
104
|
stepName = "Remove old inapplicableIf tables";
|
105
|
tableName = "TermNode_DefinedTermBase_InapplicableIf";
|
106
|
TableDropper.NewInstance(stepList, stepName, tableName, INCLUDE_AUDIT, true);
|
107
|
|
108
|
//#8468 remove old onlyapplicableIf tables
|
109
|
stepName = "Remove old onlyapplicableIf tables";
|
110
|
tableName = "TermNode_DefinedTermBase_OnlyApplicable";
|
111
|
TableDropper.NewInstance(stepList, stepName, tableName, INCLUDE_AUDIT, true);
|
112
|
|
113
|
return stepList;
|
114
|
}
|
115
|
|
116
|
@Override
|
117
|
public ISchemaUpdater getPreviousUpdater() {
|
118
|
return SchemaUpdater_5111_5112.NewInstance();
|
119
|
}
|
120
|
}
|