Changing the sql* management commands to use schema editor

This refers to the https://code.djangoproject.com/ticket/22611 ticket.