public final class Update extends Object
Schema version | Description |
---|---|
90 | The schema as released in BASE 2.17. For information about schema changes before this check the BASE 2.17 code. |
100 | The schema as released in BASE 3.0. We don't list all changes here. |
101 and 102 |
Fixes an issue with duplicate FileSetMemberData entries
due to a bug in the upgrade program. Make sure that the unique
constraint that should prevent duplicates exists.
|
103 |
Added ReporterCloneTemplateData and related classes. No
special update is required.
|
104 |
Make ExperimentData AnnotatableData . No
special update is required.
|
105 |
Added ItemSubtypeData.getPushAnnotations() . All existing subtypes
are set to 'false'.
|
106 |
Added BioPlateData.getEntryDate() and BioPlateData.getEventDate() .
All existing bioplates get a null value.
|
107 |
Added BioPlateTypeData.getStorageType()
All existing bioplate types get a null value.
|
108 |
Added BioPlateData.getSection() , BioPlateData.getTray()
and BioPlateData.getPosition()
All existing bioplates get null values.
|
109 and 110 |
Added DerivedBioAssayData.getPhysicalBioAssays() and DerivedBioAssayData.getParents()
and removed DerivedBioAssayData.getPhysicalBioAssay() and
DerivedBioAssayData.getParent() . Existing derived bioassays are updated in a two-step
procedure. The first step is to copy existing information to the new tables and the second step is
to drop columns that are no longer needed.
|
111 | Not an actual database schema change, but we need to remove annotation sets that have been created without any annotations by the annotation importer and BASE 1->2 migration. |
112 | Not an actual database schema change, but we need to fix the parent_id and parent_type columns in the BioMaterials table to really reflect what is in the BioMaterialEventSources2 table. For more info see BASE ticket: http://base.thep.lu.se/ticket/1745 |
113 |
Made Hardware , Software , Tag and BioMaterialList
Annotatable items. No special database update is needed. Only increase
the schema version.
|
114 |
Added ChangeHistoryDetailData.getOldValue() and ChangeHistoryDetailData.getNewValue() .
An update that changes the log format for annotation changes is needed to make log entries
using the same format.
|
115 |
Added AnnotationTypeData.getDisableLogOfValues() . The update should set
the value for all existing annotation types to false.
|
116 |
Added JobData.getExternalId() and made JobData a ShareableData item.
No special database update is needed. Only increase the schema version.
|
117 |
Added FileServerData.getRootPath() and FileServerData.getSshFingerprint() .
No special database update is needed. Only increase the schema version.
|
118 |
Added SchemaVersionData.getAppId() .
The update will set the app id for the current entry to 'net.sf.basedb.core'
and the update the schema version.
|
119 |
Added AnnotationTypeData.getDisableInheritance() .
The update will set the value to FALSE for all existing annotation types.
|
120 |
Added ItemListData and removed BioMaterialListData .
The update will convert all existing biomaterial lists to item lists
and make other changes as are requried to keep things working.
|
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
log
Log core events.
|
Constructor and Description |
---|
Update() |
Modifier and Type | Method and Description |
---|---|
static void |
adjustExistingItems(ProgressReporter progress,
int schemaVersion,
String rootLogin,
String rootPassword)
Adjust the existing items in the database to be compatible with the latest mappings.
|
private static void |
cleanContextFromProperty(Session session,
Item itemType,
String propertyName,
String replacementPropertyName,
boolean forceRemoveFilter) |
private static void |
createIndex(Session session,
boolean unique,
String indexName,
String tableName,
String... columnNames) |
private static void |
dropColumn(Session session,
String tableName,
String columnName,
ProgressReporter progress) |
private static void |
dropIndex(Session session,
boolean unique,
String tableName,
String... columnNames) |
private static void |
dropTable(Session session,
String tableName) |
(package private) static int |
getSchemaVersion(Session session,
String appId) |
(package private) static int |
getSchemaVersionInTransaction(Session session,
String appId)
Get the current schema version number as it is stored in the database.
|
private static TableInfo |
getTableInfo(Session session,
String tableName) |
static int |
recalculateRemainingQuantity(ProgressReporter progress)
Vefify and update the remaining quantity of all biomaterials.
|
private static void |
removeContext(Session session,
int itemType)
Remove context-related information for the given item type.
|
private static String |
replaceInCommaSeparatedList(String list,
String find,
String replacement) |
private static void |
setSchemaVersion(Session session,
int schemaVersion) |
(package private) static void |
setSchemaVersion(Session session,
String appId,
int schemaVersion,
int build)
Update the database with a new schema version number.
|
private static int |
setSchemaVersionInTransaction(Session session,
int schemaVersion)
Update the schema version version number using a new transaction.
|
static void |
updateDatabase(ProgressReporter progress,
String rootLogin,
String rootPassword)
Update the database by modifying existing items to follow new requirements.
|
private static int |
updateToSchemaVersion101(Session session)
Remove duplicate file set members.
|
private static int |
updateToSchemaVersion102(Session session)
Add unique index on FileSetMembers(fileset_id,datafiletype_id,file_id)
|
private static int |
updateToSchemaVersion110(Session session,
int currentSchemaVersion)
Move derived bioassay parent items to different tables.
|
private static int |
updateToSchemaVersion111(Session session,
ProgressReporter progress)
Remove annotation sets that have no annotation values and no inherited annotations.
|
private static int |
updateToSchemaVersion112(Session session,
ProgressReporter progress)
Ensure that parent_id and parent_type in BioMaterials table is correct
when compared to BioMaterialEventSources2 table.
|
private static int |
updateToSchemaVersion114(Session session,
ProgressReporter progress)
Ensure that old log entries for annotation changes use the same text format
that is used after this update.
|
private static int |
updateToSchemaVersion120(Session session)
Transfer existing biomaterial lists to item lists.
|
(package private) static void |
verifyRootLoginAndPassword(String login,
String password)
Verify the root user login and password.
|
public static void updateDatabase(ProgressReporter progress, String rootLogin, String rootPassword) throws BaseException
progress
- An object implementing the ProgressReporter
interfacerootLogin
- The root user loginrootPassword
- The root user passwordBaseException
static void verifyRootLoginAndPassword(String login, String password)
static int getSchemaVersionInTransaction(Session session, String appId) throws BaseException
BaseException
static int getSchemaVersion(Session session, String appId) throws BaseException
BaseException
static void setSchemaVersion(Session session, String appId, int schemaVersion, int build) throws BaseException
schemaVersion
- The new schema version numberBaseException
private static void setSchemaVersion(Session session, int schemaVersion) throws BaseException
BaseException
private static int setSchemaVersionInTransaction(Session session, int schemaVersion)
schemaVersion
- The new schema version numberpublic static void adjustExistingItems(ProgressReporter progress, int schemaVersion, String rootLogin, String rootPassword) throws BaseException
progress
- An object implementing the ProgressReporter
interfacerootLogin
- The root user loginrootPassword
- The root user passwordBaseException
private static int updateToSchemaVersion101(Session session) throws BaseException
BaseException
private static int updateToSchemaVersion102(Session session) throws BaseException
BaseException
private static int updateToSchemaVersion110(Session session, int currentSchemaVersion) throws BaseException
BaseException
private static int updateToSchemaVersion111(Session session, ProgressReporter progress) throws BaseException
BaseException
private static int updateToSchemaVersion112(Session session, ProgressReporter progress) throws BaseException
BaseException
private static int updateToSchemaVersion114(Session session, ProgressReporter progress) throws BaseException
BaseException
private static int updateToSchemaVersion120(Session session) throws BaseException
BaseException
public static int recalculateRemainingQuantity(ProgressReporter progress) throws BaseException
BaseException
private static TableInfo getTableInfo(Session session, String tableName) throws SQLException
SQLException
private static void dropColumn(Session session, String tableName, String columnName, ProgressReporter progress) throws SQLException
SQLException
private static void dropIndex(Session session, boolean unique, String tableName, String... columnNames) throws SQLException
SQLException
private static void createIndex(Session session, boolean unique, String indexName, String tableName, String... columnNames) throws SQLException
SQLException
private static void removeContext(Session session, int itemType)
private static void cleanContextFromProperty(Session session, Item itemType, String propertyName, String replacementPropertyName, boolean forceRemoveFilter)