tsainez / bobchat

Social media network for University of California, Merced students.
MIT License
1 stars 0 forks source link

Order in which population from CSV files matters when using foreign keys #5

Closed VasquezNathan closed 2 years ago

VasquezNathan commented 2 years ago

https://github.com/tsainez/bobchat/blob/1ace7ea881f05a791407b7c88f040a9f9b9f535a/bobchat/db.py#L78

VasquezNathan commented 2 years ago

The order of the list generated by os.listdir('bobchat/csv') is not guaranteed to be in an order that doesn't cause issues with the foreign key integrity. A temporary fix would be to just hardcode the list like so for file_name in ['users.csv','dens.csv','posts.csv','comments.csv','post_like_assoc.csv','user_den_assoc.csv']: