I would have though that setting the column as "auto increment" could have solved the problem but seems not..