DatabaseOperations merge from Django 1.7