'Write your forwards methods here.'

def forwards(self, orm):

    if (connection.vendor == 'sqlite'):
        transaction.set_autocommit(True)
    qs = orm.Release.objects.all().select_related('project')
    for r in RangeQuerySetWrapperWithProgressBar(qs):
        if (not r.organization_id):
            orm.Release.objects.filter(id=r.id).update(organization=r.project.organization_id)
        try:
            with transaction.atomic():
                orm.ReleaseProject.objects.create(release=r, project=r.project)
        except IntegrityError:
            pass
