Class 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 the XWikiUsersDocumentInitializer 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 $