def migrateCategoryDateIndex(): IndexesHolder()._getIdx()["backupCategoryDate"] = IndexesHolder().getIndex( "categoryDate") newIdx = CategoryDayIndex() newIdx.buildIndex() IndexesHolder()._getIdx()["categoryDate"] = newIdx print "Migration was successful"
def categoryDateIndexWithoutVisibility(dbi, withRBDB, prevVersion): """ Create category date index without visibility. """ IndexesHolder()._getIdx()['categoryDate']._useVisibility = True if 'categoryDateAll' not in IndexesHolder()._getIdx(): newIdx = CategoryDayIndex(visibility=False) IndexesHolder()._getIdx()['categoryDateAll'] = newIdx newIdx.buildIndex(dbi)
def categoryDateIndexMigration(dbi, withRBDB, prevVersion): """ Replacing category date indexes. """ if "backupCategoryDate" not in IndexesHolder()._getIdx(): categoryDate = IndexesHolder().getIndex("categoryDate") IndexesHolder()._getIdx()["backupCategoryDate"] = categoryDate newIdx = CategoryDayIndex() newIdx.buildIndex(dbi) IndexesHolder()._getIdx()["categoryDate"] = newIdx else: print """categoryDateIndexMigration: new categoryDate index has """ \ """NOT been generated because the index backup already exists. If you still want to regenerate it, please, do it manually using """ \ """bin/migration/CategoryDate.py"""
def migrateCategoryDateIndex(): IndexesHolder()._getIdx()["backupCategoryDate"] = IndexesHolder().getIndex("categoryDate") newIdx = CategoryDayIndex() newIdx.buildIndex() IndexesHolder()._getIdx()["categoryDate"] = newIdx print "Migration was successful"