Project

General

Profile

Revision 9866eb9a

ID9866eb9af1f847673cd65b1e0bffa9d5fc646bcf
Parent b10eca3b
Child 8f9d64cd, 49532c71

Added by Andreas Müller over 3 years ago

ref #6529, ref #5258, ref #6528 improve update script for Registration, WorkingSet changes and Reference.accessed

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v41_47/SchemaUpdater_41_47.java
57 57
		String newColumnName;
58 58
		String oldColumnName;
59 59

  
60
		List<ISchemaUpdaterStep> stepList = new ArrayList<ISchemaUpdaterStep>();
60
		List<ISchemaUpdaterStep> stepList = new ArrayList<>();
61 61

  
62 62
		//#6529
63 63
		//Extend WorkingSet to allow a more fine grained definiton of taxon set
......
80 80
        //subtree filter
81 81
        stepName= "Add geo filter MN table to WorkingSet";
82 82
        String firstTableName = "WorkingSet";
83
        String secondTableName = "DefinedTermBase";
84
        String secondTableAlias = "NamedArea";
83
        String secondTableName = "NamedArea";
84
        String secondTableAlias = "geoFilter";
85 85
        boolean hasSortIndex = false;
86 86
        boolean secondTableInKey = true;
87
        step = MnTableCreator.NewMnInstance(stepName, firstTableName, null, secondTableName, secondTableAlias, SchemaUpdaterBase.INCLUDE_AUDIT, hasSortIndex, secondTableInKey);
87
        step = MnTableCreator.NewMnInstance(stepName, firstTableName, null, secondTableName, secondTableAlias, INCLUDE_AUDIT, hasSortIndex, secondTableInKey);
88 88
        stepList.add(step);
89 89

  
90 90
        //subtree filter
91 91
        stepName= "Add subtree filter MN table to WorkingSet";
92 92
        firstTableName = "WorkingSet";
93 93
        secondTableName = "TaxonNode";
94
        secondTableAlias = "taxonSubtreeFilter";
94 95
        hasSortIndex = false;
95 96
        secondTableInKey = true;
96
        step = MnTableCreator.NewMnInstance(stepName, firstTableName, null, secondTableName, secondTableAlias, SchemaUpdaterBase.INCLUDE_AUDIT, hasSortIndex, secondTableInKey);
97
        step = MnTableCreator.NewMnInstance(stepName, firstTableName, null, secondTableName, secondTableAlias, INCLUDE_AUDIT, hasSortIndex, secondTableInKey);
97 98
        stepList.add(step);
98 99

  
99 100
        //#6258
100 101
        stepName = "Add Registration table";
101
        tableName = "IntextReference";
102
        tableName = "Registration";
102 103
        String[] columnNames = new String[]{"identifier","specificIdentifier","registrationDate","status",
103 104
                "institution_id","name_id","submitter_id"};
104 105
        String[] referencedTables = new String[]{null, null, null, null,
......
108 109
                columnNames, columnTypes, referencedTables, INCLUDE_AUDIT);
109 110
        stepList.add(step);
110 111

  
112
        //add blockedBy_id
113
        stepName= "Add blockedBy_id to Registration";
114
        firstTableName = "Registration";
115
        secondTableName = "Registration";
116
        secondTableAlias = "blockedBy";
117
        hasSortIndex = false;
118
        secondTableInKey = true;
119
        step = MnTableCreator.NewMnInstance(stepName, firstTableName, null, secondTableName, secondTableAlias, INCLUDE_AUDIT, hasSortIndex, secondTableInKey);
120
        stepList.add(step);
121

  
122
        //add type designations
123
        stepName= "Add type designations to Registration";
124
        firstTableName = "Registration";
125
        secondTableName = "TypeDesignationBase";
126
        secondTableAlias = "typeDesignations";
127
        hasSortIndex = false;
128
        secondTableInKey = true;
129
        step = MnTableCreator.NewMnInstance(stepName, firstTableName, null, secondTableName, secondTableAlias, INCLUDE_AUDIT, hasSortIndex, secondTableInKey);
130
        stepList.add(step);
131

  
132
        //#5258
133
        //Add "accessed" to Reference
134
        stepName = "Add 'accessed' to Reference";
135
        tableName = "Reference";
136
        newColumnName = "accessed";
137
        step = ColumnAdder.NewDateTimeInstance(stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL);
138
        stepList.add(step);
139

  
111 140
        return stepList;
112 141
    }
113 142

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)