I’m trying to have a model/table with duplicate information in it. The reason for this is so that the same data can be written to the table under different users and found for each user. However, I want a quick easy way to identify which information is a duplicate of other information. I think the best way to do this would be to have an item_id of sorts that increments with each “set” of entries to the table. Is there a way to do this without including another table that stores the information without attributing it to users?
I’m trying to have a model/table with duplicate information in it. The reason for
Share
Actually what I was looking for was a PostgreSQL Sequence. Here’s the code I ended up using in my migration
And then when querying I use
For my purposes this works fairly well and I can use it to have a unique ID for which I control the increment.