Class R1138000XWIKI16709DataMigration
- java.lang.Object
-
- com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration
-
- com.xpn.xwiki.store.migration.hibernate.R1138000XWIKI16709DataMigration
-
- All Implemented Interfaces:
DataMigration
,HibernateDataMigration
@Component @Named("R1138000XWIKI16709") @Singleton public class R1138000XWIKI16709DataMigration extends AbstractHibernateDataMigration
Migration for XWIKI-16709: the disable property is removed and a checked_email property is added from XWikiUsers. Migration does this for each XWikiUser documents: - Get the disable property - Get the active property - Create a new checked_email property with the active property value - If the disable property existed: * Set the active property with the disable property value * Remove the disable property Note that we willingly don't put the new email_checked property in the XWikiUser class, but we only put the property values in the user objects. The reason is that we don't want the XClassMigratorListener to be called by modifying the XClass since it would iterate over all user objects and save them a second time. Instead, we rely solely on theXWikiUsersDocumentInitializer
to put the property on the xclass: when the XClassMigratorListener will be called, the properties will be already present in the objects, so we avoid a new save. NB: The minor version of the migration is incremented with 30 because of a previous migration in 11 cycle badly named.- Since:
- 11.8RC1
- Version:
- $Id: e48f4429e5ab83e7e9913fd1417b533e20b2d7c1 $
-
-
Field Summary
-
Fields inherited from class com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration
componentManager, manager
-
-
Constructor Summary
Constructors Constructor Description R1138000XWIKI16709DataMigration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
XWikiDBVersion
getVersion()
protected void
hibernateMigrate()
Execute the migration itself.-
Methods inherited from class com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration
getCurrentDBVersion, getLiquibaseChangeLog, getName, getPreHibernateLiquibaseChangeLog, getStore, getXWikiContext, migrate, shouldExecute
-
-
-
-
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).
-
hibernateMigrate
protected 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.
-
-