Indexing a dataframe ahead of seeding to database
Briefly

The approach of creating shop_ids based on the index from shops_df may introduce inconsistencies if the shop names are not unique, leading to potential data integrity issues.
Using a foreign key like shop_id after querying from the database ensures that your relationships between tables are accurate, reflecting the true data state.
Read at SitePoint Forums | Web Development & Design Community
[
]
[
|
]