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.v33_34;
|
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.ColumnAdder;
|
18
|
import eu.etaxonomy.cdm.database.update.ColumnNameChanger;
|
19
|
import eu.etaxonomy.cdm.database.update.ColumnRemover;
|
20
|
import eu.etaxonomy.cdm.database.update.ColumnTypeChanger;
|
21
|
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
|
22
|
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
|
23
|
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
|
24
|
import eu.etaxonomy.cdm.database.update.SimpleSchemaUpdaterStep;
|
25
|
import eu.etaxonomy.cdm.database.update.TableCreator;
|
26
|
import eu.etaxonomy.cdm.database.update.TableDroper;
|
27
|
import eu.etaxonomy.cdm.database.update.v31_33.SchemaUpdater_33_331;
|
28
|
|
29
|
/**
|
30
|
* @author a.mueller
|
31
|
* @created Jan 14, 2014
|
32
|
*/
|
33
|
public class SchemaUpdater_331_34 extends SchemaUpdaterBase {
|
34
|
|
35
|
@SuppressWarnings("unused")
|
36
|
private static final Logger logger = Logger.getLogger(SchemaUpdater_331_34.class);
|
37
|
private static final String startSchemaVersion = "3.3.1.0.201401140000";
|
38
|
private static final String endSchemaVersion = "3.4.0.0.201407010000";
|
39
|
|
40
|
// ********************** FACTORY METHOD *************************************
|
41
|
|
42
|
public static SchemaUpdater_331_34 NewInstance() {
|
43
|
return new SchemaUpdater_331_34();
|
44
|
}
|
45
|
|
46
|
/**
|
47
|
* @param startSchemaVersion
|
48
|
* @param endSchemaVersion
|
49
|
*/
|
50
|
protected SchemaUpdater_331_34() {
|
51
|
super(startSchemaVersion, endSchemaVersion);
|
52
|
}
|
53
|
|
54
|
@Override
|
55
|
protected List<ISchemaUpdaterStep> getUpdaterList() {
|
56
|
|
57
|
String stepName;
|
58
|
String tableName;
|
59
|
ISchemaUpdaterStep step;
|
60
|
String columnName;
|
61
|
String newColumnName;
|
62
|
String oldColumnName;
|
63
|
|
64
|
List<ISchemaUpdaterStep> stepList = new ArrayList<ISchemaUpdaterStep>();
|
65
|
|
66
|
//TODO H2 / PostGreSQL / SQL Server
|
67
|
//UserAccount unique
|
68
|
stepName = "Update User unique indexes";
|
69
|
tableName = "UserAccount";
|
70
|
columnName = "username";
|
71
|
step = UsernameConstraintUpdater.NewInstance(stepName, tableName, columnName);
|
72
|
stepList.add(step);
|
73
|
|
74
|
//TODO H2 / PostGreSQL / SQL Server
|
75
|
//PermissionGroup unique
|
76
|
stepName = "Update Group unique indexes";
|
77
|
tableName = "PermissionGroup";
|
78
|
columnName = "name";
|
79
|
step = UsernameConstraintUpdater.NewInstance(stepName, tableName, columnName);
|
80
|
stepList.add(step);
|
81
|
|
82
|
//TODO H2 / PostGreSQL / SQL Server
|
83
|
//GrantedAuthority unique
|
84
|
stepName = "Update User unique indexes";
|
85
|
tableName = "GrantedAuthorityImpl";
|
86
|
columnName = "authority";
|
87
|
step = UsernameConstraintUpdater.NewInstance(stepName, tableName, columnName);
|
88
|
stepList.add(step);
|
89
|
|
90
|
//TODO H2 / PostGreSQL / SQL Server
|
91
|
stepName = "Add label column to derived unit";
|
92
|
tableName = "SpecimenOrObservationBase";
|
93
|
columnName = "originalLabelInfo";
|
94
|
step = ColumnAdder.NewClobInstance(stepName, tableName, columnName, INCLUDE_AUDIT);
|
95
|
stepList.add(step);
|
96
|
|
97
|
|
98
|
//TODO test with data and H2 / PostGreSQL / SQL Server
|
99
|
//set default value to true where required
|
100
|
stepName = "Set publish to true if null";
|
101
|
String query = " UPDATE @@TaxonBase@@ " +
|
102
|
" SET publish = @TRUE@ " +
|
103
|
" WHERE DTYPE IN ('Synonym') AND publish IS NULL ";
|
104
|
step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, query, "TaxonBase", 99);
|
105
|
stepList.add(step);
|
106
|
|
107
|
|
108
|
addIdentifierTables(stepList);
|
109
|
|
110
|
|
111
|
//remove series from Reference #4293
|
112
|
stepName = "Copy series to series part";
|
113
|
String sql = " UPDATE Reference r " +
|
114
|
" SET r.seriespart = r.series " +
|
115
|
" WHERE r.series is NOT NULL AND r.seriesPart IS NULL ";
|
116
|
step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql, "Reference", 99);
|
117
|
stepList.add(step);
|
118
|
|
119
|
stepName = "Set series to NULL";
|
120
|
sql = " UPDATE Reference r " +
|
121
|
" SET r.series = NULL " +
|
122
|
" WHERE r.series = r.seriesPart ";
|
123
|
step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql, "Reference", 99);
|
124
|
stepList.add(step);
|
125
|
|
126
|
//TODO check all series are null
|
127
|
|
128
|
stepName = "Remove series column";
|
129
|
tableName = "Reference";
|
130
|
oldColumnName = "series";
|
131
|
step = ColumnRemover.NewInstance(stepName, tableName, oldColumnName, INCLUDE_AUDIT);
|
132
|
stepList.add(step);
|
133
|
|
134
|
//authorTeam -> authorship
|
135
|
stepName = "Rename Reference.authorTeam column";
|
136
|
tableName = "Reference";
|
137
|
oldColumnName = "authorTeam_id";
|
138
|
newColumnName = "authorship_id";
|
139
|
step = ColumnNameChanger.NewIntegerInstance(stepName, tableName, oldColumnName, newColumnName, INCLUDE_AUDIT);
|
140
|
stepList.add(step);
|
141
|
//
|
142
|
//remove CDM_VIEW #4316
|
143
|
stepName = "Remove CDM_VIEW_CDM_VIEW table";
|
144
|
tableName = "CDM_VIEW_CDM_VIEW";
|
145
|
boolean ifExists = true;
|
146
|
step = TableDroper.NewInstance(stepName, tableName, ! INCLUDE_AUDIT, ifExists);
|
147
|
stepList.add(step);
|
148
|
|
149
|
stepName = "Remove CDM_VIEW table";
|
150
|
tableName = "CDM_VIEW";
|
151
|
ifExists = true;
|
152
|
step = TableDroper.NewInstance(stepName, tableName, ! INCLUDE_AUDIT, ifExists);
|
153
|
stepList.add(step);
|
154
|
|
155
|
|
156
|
//TODO not null on username, groupname and authority #4382
|
157
|
|
158
|
//DnaQuality #4434
|
159
|
//Identifier
|
160
|
stepName = "Create dna quality";
|
161
|
boolean includeCdmBaseAttributes = true;
|
162
|
tableName = "DnaQuality";
|
163
|
String[] columnNames = new String[]{"purificationmethod","concentration","ratioofabsorbance260_230", "ratioofabsorbance260_280","qualitycheckdate","concentrationunit_id","qualityterm_id"};
|
164
|
String[] columnTypes = new String[]{"string_255","double","double","double","datetime","int","int"};
|
165
|
String[] referencedTables = new String[]{null,null,null,null,null,"DefinedTermBase","DefinedTermBase"};
|
166
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
167
|
stepList.add(step);
|
168
|
|
169
|
//DnaQuality in TissueSample
|
170
|
//TODO H2 / PostGreSQL / SQL Server
|
171
|
stepName = "Add foreign key to dna quality";
|
172
|
tableName = "SpecimenOrObservationBase";
|
173
|
newColumnName = "dnaQuality_id";
|
174
|
boolean notNull = false;
|
175
|
String referencedTable = "DnaQuality";
|
176
|
step = ColumnAdder.NewIntegerInstance(stepName, tableName, newColumnName, INCLUDE_AUDIT, notNull, referencedTable);
|
177
|
stepList.add(step);
|
178
|
|
179
|
//time scope for classifications
|
180
|
//TODO H2 / PostGreSQL / SQL Server
|
181
|
stepName = "Add time scope (start) for classifications";
|
182
|
tableName = "Classification";
|
183
|
newColumnName = "timeperiod_start";
|
184
|
int length = 255;
|
185
|
step = ColumnAdder.NewStringInstance(stepName, tableName, newColumnName, length, INCLUDE_AUDIT);
|
186
|
stepList.add(step);
|
187
|
|
188
|
//TODO H2 / PostGreSQL / SQL Server
|
189
|
stepName = "Add time scope (end) for classifications";
|
190
|
tableName = "Classification";
|
191
|
newColumnName = "timeperiod_end";
|
192
|
length = 255;
|
193
|
step = ColumnAdder.NewStringInstance(stepName, tableName, newColumnName, length, INCLUDE_AUDIT);
|
194
|
stepList.add(step);
|
195
|
|
196
|
//TODO H2 / PostGreSQL / SQL Server
|
197
|
stepName = "Add time scope (freetext) for classifications";
|
198
|
tableName = "Classification";
|
199
|
newColumnName = "timeperiod_freetext";
|
200
|
length = 255;
|
201
|
step = ColumnAdder.NewStringInstance(stepName, tableName, newColumnName, length, INCLUDE_AUDIT);
|
202
|
stepList.add(step);
|
203
|
|
204
|
//Classification_GeoScope
|
205
|
stepName = "Create Classification_GeoScope table";
|
206
|
includeCdmBaseAttributes = false;
|
207
|
tableName = "Classification_GeoScope";
|
208
|
columnNames = new String[]{"Classification_id","geoScopes_id"};
|
209
|
columnTypes = new String[]{"int","int"};
|
210
|
referencedTables = new String[]{"Classification","DefinedTermBase"};
|
211
|
TableCreator creator = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
212
|
creator.setPrimaryKeyParams("Classification_id,geoScopes_id", "REV,Classification_id,geoScopes_id");
|
213
|
stepList.add(creator);
|
214
|
|
215
|
//Classification_Description
|
216
|
stepName = "Create Classification_Description table";
|
217
|
includeCdmBaseAttributes = false;
|
218
|
tableName = "Classification_Description";
|
219
|
columnNames = new String[]{"Classification_id","description_id","description_mapkey_id"};
|
220
|
columnTypes = new String[]{"int","int","int"};
|
221
|
referencedTables = new String[]{"Classification","LanguageString","DefinedTermBase"};
|
222
|
creator = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
223
|
creator.setPrimaryKeyParams("Classification_id", "REV,Classification_id,description_id,description_mapkey_id");
|
224
|
stepList.add(creator);
|
225
|
|
226
|
//Primer.sequence type #4139
|
227
|
stepName = "Add sequence string column to primer";
|
228
|
tableName = "Primer";
|
229
|
newColumnName = "sequence_string";
|
230
|
step = ColumnAdder.NewClobInstance(stepName, tableName, newColumnName,
|
231
|
INCLUDE_AUDIT);
|
232
|
stepList.add(step);
|
233
|
|
234
|
//Primer.sequence length #4139
|
235
|
stepName = "Add sequence length column to primer";
|
236
|
tableName = "Primer";
|
237
|
newColumnName = "sequence_length";
|
238
|
notNull = false;
|
239
|
referencedTable = null;
|
240
|
step = ColumnAdder.NewIntegerInstance(stepName, tableName, newColumnName, INCLUDE_AUDIT, null, notNull);
|
241
|
stepList.add(step);
|
242
|
|
243
|
//EntityValidation
|
244
|
stepName = "Create EntityValidation table";
|
245
|
includeCdmBaseAttributes = true;
|
246
|
tableName = "EntityValidation";
|
247
|
columnNames = new String[]{"crudeventtype","userfriendlydescription","userfriendlytypename",
|
248
|
"validatedentityclass","validatedentityid","validatedentityuuid"};
|
249
|
columnTypes = new String[]{"string_255","string_255","string_255","string_255","int","string_36"};
|
250
|
referencedTables = new String[]{null,null,null,null,null,null};
|
251
|
creator = TableCreator.NewNonVersionableInstance(stepName, tableName, columnNames, columnTypes, referencedTables);
|
252
|
stepList.add(creator);
|
253
|
|
254
|
//EntityConstraintViolation
|
255
|
stepName = "Create EntityConstraintViolation table";
|
256
|
includeCdmBaseAttributes = true;
|
257
|
tableName = "EntityConstraintViolation";
|
258
|
columnNames = new String[]{"invalidvalue","message","propertypath","severity","userfriendlyfieldname",
|
259
|
"validator","entityvalidationresult_id"};
|
260
|
columnTypes = new String[]{"string_255","string_255","string_255","string_255","string_255","string_255","int"};
|
261
|
referencedTables = new String[]{null,null,null,null,null,null,"EntityValidation"};
|
262
|
creator = TableCreator.NewNonVersionableInstance(stepName, tableName, columnNames, columnTypes, referencedTables);
|
263
|
stepList.add(creator);
|
264
|
|
265
|
//make OriginalSourceBase.sourceType allow NULL
|
266
|
stepName = "Remove NOT NULL from sourceType";
|
267
|
tableName = "OriginalSourceBase_AUD";
|
268
|
oldColumnName = "sourceType";
|
269
|
// query = "ALTER TABLE OriginalSourceBase_AUD " +
|
270
|
// " CHANGE COLUMN sourceType sourceType VARCHAR(4) NULL ";
|
271
|
step = ColumnTypeChanger.NewStringSizeInstance(stepName, tableName, oldColumnName, 4, ! INCLUDE_AUDIT);
|
272
|
stepList.add(step);
|
273
|
|
274
|
|
275
|
//remove sequence_id column //we do not move data as we do not expect data available yet #4139
|
276
|
//we put this to the end as it seems to fail with INNODB
|
277
|
stepName = "Remove sequence_id column from primer";
|
278
|
tableName = "Primer";
|
279
|
oldColumnName = "sequence_id";
|
280
|
step = ColumnRemover.NewInstance(stepName, tableName, oldColumnName, INCLUDE_AUDIT);
|
281
|
stepList.add(step);
|
282
|
|
283
|
|
284
|
// WE REMOVED THIS FROM THE SCRIPT BECAUSE IT FAILS WITH INNODB
|
285
|
// //change size of AgentBase_contact_urls.contact_urls_element #3920
|
286
|
// stepName = "Change length of AgentBase_contact_urls.contact_urls_element";
|
287
|
// tableName = "AgentBase_contact_urls";
|
288
|
// columnName = "contact_urls_element";
|
289
|
// step = ColumnTypeChanger.NewStringSizeInstance(stepName, tableName,
|
290
|
// columnName, 330, INCLUDE_AUDIT);
|
291
|
//// stepList.add(step);
|
292
|
|
293
|
|
294
|
return stepList;
|
295
|
|
296
|
}
|
297
|
|
298
|
private void addIdentifierTables(List<ISchemaUpdaterStep> stepList) {
|
299
|
|
300
|
//Identifier
|
301
|
String stepName = "Create Identifier table";
|
302
|
boolean includeCdmBaseAttributes = true;
|
303
|
String tableName = "Identifier";
|
304
|
String[] columnNames = new String[]{"identifier","identifiedObj_type", "identifiedObj_id","type_id"};
|
305
|
String[] columnTypes = new String[]{"string_800","string_255","int","int"};
|
306
|
String[] referencedTables = new String[]{null,null,null,"DefinedTermBase"};
|
307
|
TableCreator step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
308
|
stepList.add(step);
|
309
|
|
310
|
//AgentBase_Identifier
|
311
|
stepName = "Create AgentBase_Identifier table";
|
312
|
includeCdmBaseAttributes = false;
|
313
|
tableName = "AgentBase_Identifier";
|
314
|
columnNames = new String[]{"AgentBase_id","identifiers_id","sortIndex"};
|
315
|
columnTypes = new String[]{"int","int","int"};
|
316
|
referencedTables = new String[]{"AgentBase","Identifier",null};
|
317
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
318
|
step.setPrimaryKeyParams("AgentBase_id,identifiers_id", "REV,AgentBase_id,identifiers_id");
|
319
|
stepList.add(step);
|
320
|
|
321
|
//Classification_Identifier
|
322
|
stepName = "Create Classification_Identifier table";
|
323
|
includeCdmBaseAttributes = false;
|
324
|
tableName = "Classification_Identifier";
|
325
|
columnNames = new String[]{"Classification_id","identifiers_id","sortIndex"};
|
326
|
columnTypes = new String[]{"int","int","int"};
|
327
|
referencedTables = new String[]{"Classification","Identifier",null};
|
328
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
329
|
step.setPrimaryKeyParams("Classification_id,identifiers_id", "REV,Classification_id,identifiers_id");
|
330
|
stepList.add(step);
|
331
|
|
332
|
//Collection_Identifier
|
333
|
stepName = "Create Collection_Identifier table";
|
334
|
includeCdmBaseAttributes = false;
|
335
|
tableName = "Collection_Identifier";
|
336
|
columnNames = new String[]{"Collection_id","identifiers_id","sortIndex"};
|
337
|
columnTypes = new String[]{"int","int","int"};
|
338
|
referencedTables = new String[]{"Collection","Identifier",null};
|
339
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
340
|
step.setPrimaryKeyParams("Collection_id,identifiers_id", "REV,Collection_id,identifiers_id");
|
341
|
stepList.add(step);
|
342
|
|
343
|
//DefinedTermBase_Identifier
|
344
|
stepName = "Create DefinedTermBase_Identifier table";
|
345
|
includeCdmBaseAttributes = false;
|
346
|
tableName = "DefinedTermBase_Identifier";
|
347
|
columnNames = new String[]{"DefinedTermBase_id","identifiers_id","sortIndex"};
|
348
|
columnTypes = new String[]{"int","int","int"};
|
349
|
referencedTables = new String[]{"DefinedTermBase","Identifier",null};
|
350
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
351
|
step.setPrimaryKeyParams("DefinedTermBase_id,identifiers_id", "REV,DefinedTermBase_id,identifiers_id");
|
352
|
stepList.add(step);
|
353
|
|
354
|
//DescriptionBase_Identifier
|
355
|
stepName = "Create DescriptionBase_Identifier table";
|
356
|
includeCdmBaseAttributes = false;
|
357
|
tableName = "DescriptionBase_Identifier";
|
358
|
columnNames = new String[]{"DescriptionBase_id","identifiers_id","sortIndex"};
|
359
|
columnTypes = new String[]{"int","int","int"};
|
360
|
referencedTables = new String[]{"DescriptionBase","Identifier",null};
|
361
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
362
|
step.setPrimaryKeyParams("DescriptionBase_id,identifiers_id", "REV,DescriptionBase_id,identifiers_id");
|
363
|
stepList.add(step);
|
364
|
|
365
|
//FeatureTree_Identifier
|
366
|
stepName = "Create FeatureTree_Identifier table";
|
367
|
includeCdmBaseAttributes = false;
|
368
|
tableName = "FeatureTree_Identifier";
|
369
|
columnNames = new String[]{"FeatureTree_id","identifiers_id","sortIndex"};
|
370
|
columnTypes = new String[]{"int","int","int"};
|
371
|
referencedTables = new String[]{"FeatureTree","Identifier",null};
|
372
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
373
|
step.setPrimaryKeyParams("FeatureTree_id,identifiers_id", "REV,FeatureTree_id,identifiers_id");
|
374
|
stepList.add(step);
|
375
|
|
376
|
//Media_Identifier
|
377
|
stepName = "Create Media_Identifier table";
|
378
|
includeCdmBaseAttributes = false;
|
379
|
tableName = "Media_Identifier";
|
380
|
columnNames = new String[]{"Media_id","identifiers_id","sortIndex"};
|
381
|
columnTypes = new String[]{"int","int","int"};
|
382
|
referencedTables = new String[]{"Media","Identifier",null};
|
383
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
384
|
step.setPrimaryKeyParams("Media_id,identifiers_id", "REV,Media_id,identifiers_id");
|
385
|
stepList.add(step);
|
386
|
|
387
|
//PolytomousKey_Identifier
|
388
|
stepName = "Create PolytomousKey_Identifier table";
|
389
|
includeCdmBaseAttributes = false;
|
390
|
tableName = "PolytomousKey_Identifier";
|
391
|
columnNames = new String[]{"PolytomousKey_id","identifiers_id","sortIndex"};
|
392
|
columnTypes = new String[]{"int","int","int"};
|
393
|
referencedTables = new String[]{"PolytomousKey","Identifier",null};
|
394
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
395
|
step.setPrimaryKeyParams("PolytomousKey_id,identifiers_id", "REV,PolytomousKey_id,identifiers_id");
|
396
|
stepList.add(step);
|
397
|
|
398
|
//Reference_Identifier
|
399
|
stepName = "Create Reference_Identifier table";
|
400
|
includeCdmBaseAttributes = false;
|
401
|
tableName = "Reference_Identifier";
|
402
|
columnNames = new String[]{"Reference_id","identifiers_id","sortIndex"};
|
403
|
columnTypes = new String[]{"int","int","int"};
|
404
|
referencedTables = new String[]{"Reference","Identifier",null};
|
405
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
406
|
step.setPrimaryKeyParams("Reference_id,identifiers_id", "REV,Reference_id,identifiers_id");
|
407
|
stepList.add(step);
|
408
|
|
409
|
//SpecimenOrObservationBase_Identifier
|
410
|
stepName = "Create SpecimenOrObservationBase_Identifier table";
|
411
|
includeCdmBaseAttributes = false;
|
412
|
tableName = "SpecimenOrObservationBase_Identifier";
|
413
|
columnNames = new String[]{"SpecimenOrObservationBase_id","identifiers_id","sortIndex"};
|
414
|
columnTypes = new String[]{"int","int","int"};
|
415
|
referencedTables = new String[]{"SpecimenOrObservationBase","Identifier",null};
|
416
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
417
|
step.setPrimaryKeyParams("SpecimenOrObservationBase_id,identifiers_id", "REV,SpecimenOrObservationBase_id,identifiers_id");
|
418
|
stepList.add(step);
|
419
|
|
420
|
//TaxonBase_Identifier
|
421
|
stepName = "Create TaxonBase_Identifier table";
|
422
|
includeCdmBaseAttributes = false;
|
423
|
tableName = "TaxonBase_Identifier";
|
424
|
columnNames = new String[]{"TaxonBase_id","identifiers_id","sortIndex"};
|
425
|
columnTypes = new String[]{"int","int","int"};
|
426
|
referencedTables = new String[]{"TaxonBase","Identifier",null};
|
427
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
428
|
step.setPrimaryKeyParams("TaxonBase_id,identifiers_id", "REV,TaxonBase_id,identifiers_id");
|
429
|
stepList.add(step);
|
430
|
|
431
|
//TaxonNameBase_Identifier
|
432
|
stepName = "Create TaxonNameBase_Identifier table";
|
433
|
includeCdmBaseAttributes = false;
|
434
|
tableName = "TaxonNameBase_Identifier";
|
435
|
columnNames = new String[]{"TaxonNameBase_id","identifiers_id","sortIndex"};
|
436
|
columnTypes = new String[]{"int","int","int"};
|
437
|
referencedTables = new String[]{"TaxonNameBase","Identifier",null};
|
438
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
439
|
step.setPrimaryKeyParams("TaxonNameBase_id,identifiers_id", "REV,TaxonNameBase_id,identifiers_id");
|
440
|
stepList.add(step);
|
441
|
|
442
|
//TermVocabulary_Identifier
|
443
|
stepName = "Create TermVocabulary_Identifier table";
|
444
|
includeCdmBaseAttributes = false;
|
445
|
tableName = "TermVocabulary_Identifier";
|
446
|
columnNames = new String[]{"TermVocabulary_id","identifiers_id","sortIndex"};
|
447
|
columnTypes = new String[]{"int","int","int"};
|
448
|
referencedTables = new String[]{"TermVocabulary","Identifier",null};
|
449
|
step = TableCreator.NewInstance(stepName, tableName, columnNames, columnTypes, referencedTables, INCLUDE_AUDIT, includeCdmBaseAttributes);
|
450
|
step.setPrimaryKeyParams("TermVocabulary_id,identifiers_id", "REV,TermVocabulary_id,identifiers_id");
|
451
|
stepList.add(step);
|
452
|
|
453
|
}
|
454
|
|
455
|
@Override
|
456
|
public ISchemaUpdater getNextUpdater() {
|
457
|
return SchemaUpdater_34_341.NewInstance();
|
458
|
}
|
459
|
|
460
|
@Override
|
461
|
public ISchemaUpdater getPreviousUpdater() {
|
462
|
return SchemaUpdater_33_331.NewInstance();
|
463
|
}
|
464
|
|
465
|
}
|