Solr's uniqueKey field can support any of the data type classes that Solr supports. While the underlying Lucene index itself treats all stored/indexed data as text, Solr manages the translation to treat the indexed data according to data types.
The string field-type restriction you're referring to is if you have enabled the QueryElevationComponent in solr config. If you have not enabled that feature, you can make your uniqueKey a long to solve your issue.