Example #1
0
def migrateCategoryDateIndex():
    IndexesHolder()._getIdx()["backupCategoryDate"] = IndexesHolder().getIndex(
        "categoryDate")
    newIdx = CategoryDayIndex()
    newIdx.buildIndex()
    IndexesHolder()._getIdx()["categoryDate"] = newIdx
    print "Migration was successful"
Example #2
0
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)
Example #3
0
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)
Example #4
0
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"""
Example #5
0
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"""
Example #6
0
def migrateCategoryDateIndex():
    IndexesHolder()._getIdx()["backupCategoryDate"] = IndexesHolder().getIndex("categoryDate")
    newIdx = CategoryDayIndex()
    newIdx.buildIndex()
    IndexesHolder()._getIdx()["categoryDate"] = newIdx
    print "Migration was successful"