Share this page!
👨💻 Developer 🧗 Rock Climber 🎤 Occasional Speaker 📚 Likes to learn new things ✍️ Blogging @vincentntang.com
Add to My Authors
23 Sep 19
TIL there's lots of ways of
. You can either
A. Seed it with purely random data all the way
B. Seed it with realistic data
C. Seed it initially with random data, but tie that data into other tables realistically
When you seed a database, you start off with enum (that's like a dictionary that doesn't change in size). If you look at a database schema, it's the tables that are only connected one time.
Then you focus on tables that have only have 1 foreign key tied, tied to an enum
Example with a basic HR database schema. Start seeding the outlier tables first, starting with the bottom-left most and bottom-right most tables, followed by bottom-middle.
Read 11 tweets