Beispiel #1
0
def migrate_editor_eventlog():
    a = MigrationTracker('eventlog')
    id = a.get() or 0

    items = EventLog.objects.filter(type='editor',
                                    pk__gt=id).values_list('id', flat=True)

    for chunk in chunked(items, 100):
        _migrate_editor_eventlog(chunk)
        a.set(chunk[-1])
Beispiel #2
0
def migrate_editor_eventlog():
    a = MigrationTracker('eventlog')
    id = a.get() or 0

    items = EventLog.objects.filter(type='editor', pk__gt=id).values_list(
            'id', flat=True)

    for chunk in chunked(items, 100):
        _migrate_editor_eventlog(chunk)
        a.set(chunk[-1])
Beispiel #3
0
def migrate_approvals():
    a = MigrationTracker('approvals')
    id = a.get()
    if not id:
        log.warning('No last position reported from redis for '
                    'migrating approvals, exiting.')
        return

    items = (Approval.objects.filter(pk__gt=id).order_by('id')
                             .values_list('id', flat=True))

    for chunk in chunked(items, 100):
        _migrate_approvals(chunk)
        a.set(chunk[-1])