def sync_table_options(from_table, to_table, sync_auto_inc=False,
    sync_comments=False):
    """Generate the SQL statements needed to modify the Table options
       of the target table (patch), and restore them to their previous
       definition (revert)

    Args:
       from_table: A SchemaObject TableSchema Instance.
       to_table: A SchemaObject TableSchema Instance.
       sync_auto_inc: Bool, sync the tables auto increment value?
       sync_comments: Bool, sync the tbales comment field?

    Returns:
       A tuple (patch, revert) containing the SQL statements.
       A tuple of empty strings will be returned if no changes were found
    """
    p = []
    r = []
    for opt in from_table.options:
        if (opt == 'auto_increment' and not sync_auto_inc or opt ==
            'comment' and not sync_comments):
            continue
        if from_table.options[opt] != to_table.options[opt]:
            p.append(from_table.options[opt].create())
            r.append(to_table.options[opt].create())
    if p:
        return ' '.join(p), ' '.join(r)
    else:
        return '', ''
