mysql auto save 10 digit unique number

I'm using rails web application with mysql database, I need to auto save 10 digit unique number/alphanumeric for each record in a table.
The table may contain more than millions of records(in future)

**Requirement**:

 1. A 10 digit unique number should be generated only from mysql database and the generated number should not be less than 10 digit
 2. I also refered the mysql's uuid() and uuid_short() methods which returns a universal unique id, but these returns more than 10 digit number.
 3. If generated unique numbers are not in sequence then it will be much better (unpredictable to access other records such as next or previous reocrd).

**NOTE**:

 - I don't think it is better to generate the unique id by manually(applying some logic like combination of timestamp, record_id, ...etc), because additional query is needed to check uniqueness in table.
mysql auto save 10 digit unique number
===


I'm using rails web application with mysql database, I need to auto save 10 digit unique number/alphanumeric for each record in a table.
The table may contain more than millions of records(in future)

**Requirement**:

 1. A 10 digit unique number should be generated only from mysql database and the generated number should not be less than 10 digit
 2. I also refered the mysql's uuid() and uuid_short() methods which returns a universal unique id, but these returns more than 10 digit number.
 3. If generated unique numbers are not in sequence then it will be much better (unpredictable to access other records such as next or previous reocrd).

**NOTE**:

 - I don't think it is better to generate the unique id by manually(applying some logic like combination of timestamp, record_id, ...etc), because additional query is needed to check uniqueness in table.