Open SimonLab opened 6 years ago
From: http://phoenixframework.org/blog/custom-primary-key
Note: While Ecto allows us to do this, itβs not the natural path Ecto wants to take. Allowing Ecto to use an auto-incremented integer is definitely the right way to go for new applications.
Which I think push me at the begining of the project to let Ecto create its own ids. I don't think the value of defining manually our primary keys based on the Github ids is good for the time it will take us to implement this. Removing all the Ecto current primary keys will break all the association on the database. So at the end I think I would prefer at this stage to keep the current structure of the database. However I think #94 (adding index and constraints on the Github ids) will make sure that the database doesn't have any duplicates and will allow us to get data more quickly with indexes.
@SimonLab agreed. π
ref: https://github.com/dwyl/github-backup/pull/99#discussion_r174958635 Instead of letting Ecto create the ids automatically for the inserted items we can use the ids given by Github as our primary keys