I have a content type that in one of their fields need a value that is unique and auto-increment. There are several obvious solutions:
- Use the node id that is unique and auto-increment.
- The Serial module.
The problem with these solutions is that they use the MySQL auto-increments.
Drupal, by default, auto-increments the node ID (nid) and other IDs by one digit for each piece of content you create. You can see this if you visit your site by the node ID path:
http://www.example.com/node/1 http://www.example.com/node/2 http://www.example.com/node/3
However, sites that use database replication as a backup strategy (is my case) often will have non-sequential ids, meaning that you could see nids jump by two or more digits.
http://www.example.com/node/10 http://www.example.com/node/15 http://www.example.com/node/20
The MySQL auto_increment_increment variable determines how many digits to jump for each successive auto_increment value.
And then I have this problem:
How I can do to have a field with unique and auto-increments values?