'Ensure the table exists and has the correct schema.'

def ensure_schema(self):

    if self.has_table():
        return
    try:
        with self.connection.schema_editor() as editor:
            editor.create_model(self.Migration)
    except DatabaseError as exc:
        raise MigrationSchemaMissing(('Unable    to    create    the    django_migrations    table    (%s)' % exc))
