Project

General

Profile

Revision dc73d376

IDdc73d37680d4870e7a229ea36512cc585add0c09
Parent 20884bdb
Child 72032e83

Added by Andreas Müller over 1 year ago

ref #9036, ref #9037 remove old boolean columns

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/CdmUpdater.java
17 17
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
18 18
import eu.etaxonomy.cdm.database.CdmDataSource;
19 19
import eu.etaxonomy.cdm.database.ICdmDataSource;
20
import eu.etaxonomy.cdm.database.update.v512_515.SchemaUpdater_5120_5150;
20
import eu.etaxonomy.cdm.database.update.v515_5151.SchemaUpdater_5150_5151;
21 21
import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
22 22

  
23 23
/**
......
73 73
     * @return the current CDM updater
74 74
     */
75 75
    private ISchemaUpdater getCurrentSchemaUpdater() {
76
        return SchemaUpdater_5120_5150.NewInstance();
76
        return SchemaUpdater_5150_5151.NewInstance();
77 77
    }
78 78

  
79 79
    /**
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v512_515/SchemaUpdater_5120_5150.java
25 25
import eu.etaxonomy.cdm.database.update.TableNameChanger;
26 26
import eu.etaxonomy.cdm.database.update.TermRepresentationUpdater;
27 27
import eu.etaxonomy.cdm.database.update.v511_512.SchemaUpdater_5112_5120;
28
import eu.etaxonomy.cdm.database.update.v515_5151.SchemaUpdater_5150_5151;
28 29
import eu.etaxonomy.cdm.model.common.Language;
29 30
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.CdmVersion;
30 31

  
......
258 259

  
259 260
    @Override
260 261
	public ISchemaUpdater getNextUpdater() {
261
		return null;
262
		return SchemaUpdater_5150_5151.NewInstance();
262 263
	}
263 264
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v515_5151/SchemaUpdater_5150_5151.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

  
10
package eu.etaxonomy.cdm.database.update.v515_5151;
11

  
12
import java.util.ArrayList;
13
import java.util.List;
14

  
15
import org.apache.log4j.Logger;
16

  
17
import eu.etaxonomy.cdm.database.update.ColumnRemover;
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.v512_515.SchemaUpdater_5120_5150;
22
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.CdmVersion;
23

  
24
/**
25
 * @author a.mueller
26
 * @date 10.06.2020
27
 */
28
public class SchemaUpdater_5150_5151 extends SchemaUpdaterBase {
29

  
30
	@SuppressWarnings("unused")
31
	private static final Logger logger = Logger.getLogger(SchemaUpdater_5150_5151.class);
32

  
33
	private static final CdmVersion startSchemaVersion = CdmVersion.V_05_15_00;
34
	private static final CdmVersion endSchemaVersion = CdmVersion.V_05_15_01;
35

  
36
// ********************** FACTORY METHOD *************************************
37

  
38
	public static SchemaUpdater_5150_5151 NewInstance() {
39
		return new SchemaUpdater_5150_5151();
40
	}
41

  
42
	protected SchemaUpdater_5150_5151() {
43
		super(startSchemaVersion.versionString(), endSchemaVersion.versionString());
44
	}
45

  
46
	@Override
47
	protected List<ISchemaUpdaterStep> getUpdaterList() {
48

  
49
		String stepName;
50
		String tableName;
51
		String newColumnName;
52
		String columnName;
53

  
54
		List<ISchemaUpdaterStep> stepList = new ArrayList<>();
55

  
56
	    //#9037 Remove column supportsXXX
57
        stepName = "Remove column supportscategoricaldata";
58
        tableName = "DefinedTermBase";
59
        columnName = "supportscategoricaldata";
60
        ColumnRemover.NewInstance(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
61

  
62
        stepName = "Remove column supportscommontaxonname";
63
        columnName = "supportscommontaxonname";
64
        ColumnRemover.NewInstance(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
65

  
66
        stepName = "Remove column supportsdistribution";
67
        columnName = "supportsdistribution";
68
        ColumnRemover.NewInstance(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
69

  
70
        stepName = "Remove column supportsindividualassociation";
71
        columnName = "supportsindividualassociation";
72
        ColumnRemover.NewInstance(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
73

  
74
        stepName = "Remove column supportsquantitativedata";
75
        columnName = "supportsquantitativedata";
76
        ColumnRemover.NewInstance(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
77

  
78
        stepName = "Remove column supportstaxoninteraction";
79
        columnName = "supportstaxoninteraction";
80
        ColumnRemover.NewInstance(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
81

  
82
        stepName = "Remove column supportstextdata";
83
        columnName = "supportstextdata";
84
        ColumnRemover.NewInstance(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
85

  
86
        //#9036 Remove column unplaced, excluded, doubtful
87
        stepName = "Remove column excluded";
88
        tableName = "TaxonNode";
89
        columnName = "excluded";
90
        ColumnRemover.NewInstance(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
91

  
92
        stepName = "Remove column unplaced";
93
        columnName = "unplaced";
94
        ColumnRemover.NewInstance(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
95

  
96
        stepName = "Remove column doubtful";
97
        columnName = "doubtful";
98
        ColumnRemover.NewInstance(stepList, stepName, tableName, columnName, INCLUDE_AUDIT);
99

  
100

  
101

  
102
        return stepList;
103
    }
104

  
105
    @Override
106
    public ISchemaUpdater getPreviousUpdater() {
107
        return SchemaUpdater_5120_5150.NewInstance();
108
    }
109

  
110
    @Override
111
	public ISchemaUpdater getNextUpdater() {
112
		return null;
113
	}
114
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)