How can I implement child resource autogenerate int ID?
I am trying to make a note taker site with user registration. What I want to do is to make it so that once a user registers and logs in, he/she will be able to create new notes and these notes will have a serial number starting with 1 and auto generating gradually. However, these notes will also have a unique ID which is invisible to the user and this ID is unique for the whole application, not just for the user like for serial no. I am failing to understand how I can make it so that the serial number will be auto generated and starts from 1 for each new user. If I make it auto-increment, it simply increments the number disregarding the user (i.e. user 1 can create 3 notes and then user 2 will have his first note with serial no 4, whereas it should be 1).
I hope I was able to clarify the issue. Pardon me but English isn't my native language (I am from Poland).
0 comments:
Post a Comment