Class R35101XWIKI7645DataMigration
- java.lang.Object
-
- com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration
-
- com.xpn.xwiki.store.migration.hibernate.R35101XWIKI7645DataMigration
-
- All Implemented Interfaces:
DataMigration
,HibernateDataMigration
@Component @Named("R35101XWIKI7645") @Singleton public class R35101XWIKI7645DataMigration extends AbstractHibernateDataMigration
Migration for XWIKI-7564: Manually change the SQL type of long binary columns from LONG RAW to proper BLOBs when the underlying database is Oracle. More specifically, this migrator changes the attachment content and attachment archive columns from LONG RAW to BLOB, and rebuilds the indexes on those tables afterwards. The columns must be switched to BLOB since this is the expected column type when using the new mapping files. Rebuilding the indexes is needed because changing a table's columns automatically invalidates the indexes on those tables, and with unusable indexes any new insertion in those tables will trigger an exception.- Since:
- 3.5.1
- Version:
- $Id: 053efc77e5ebf708ad71f01c2e32c42fe4bc237d $
-
-
Field Summary
-
Fields inherited from class com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration
componentManager, manager
-
-
Constructor Summary
Constructors Constructor Description R35101XWIKI7645DataMigration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
XWikiDBVersion
getVersion()
void
hibernateMigrate()
Execute the migration itself.boolean
shouldExecute(XWikiDBVersion startupVersion)
-
Methods inherited from class com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration
getCurrentDBVersion, getLiquibaseChangeLog, getName, getPreHibernateLiquibaseChangeLog, getStore, getXWikiContext, migrate
-
-
-
-
Method Detail
-
getDescription
public String getDescription()
- Returns:
- a description of what the data migration does
-
getVersion
public XWikiDBVersion getVersion()
- Returns:
- data version which need migration. before you commit stuff which needs migration, you need write data migration with version = current release number (i.e 32000 for release 3.2).
-
shouldExecute
public boolean shouldExecute(XWikiDBVersion startupVersion)
- Specified by:
shouldExecute
in interfaceDataMigration
- Overrides:
shouldExecute
in classAbstractHibernateDataMigration
- Parameters:
startupVersion
- the database version when the migration process starts (before any dataMigration is applied). This is useful for data migration which need to run only when the database is in a certain version.- Returns:
- true if the migration should be executed or false otherwise
-
hibernateMigrate
public void hibernateMigrate() throws DataMigrationException, XWikiException
Description copied from class:AbstractHibernateDataMigration
Execute the migration itself.- Specified by:
hibernateMigrate
in classAbstractHibernateDataMigration
- Throws:
DataMigrationException
- on migration error.XWikiException
- on error from the store.
-
-