diddi- / flask-seeder

Flask extension for seeding database
32 stars 11 forks source link

Added deterministic ordering of seeders #3

Closed wakemaster39 closed 4 years ago

wakemaster39 commented 4 years ago

Sometimes order matters, especially with foreign keys. This allows seeders to be split up across different seeders and different files with a guaranteed order of operations they will be executed in.

Ordering is first done by a priority key if it exists, and groups with the same priority are ordered by class name.

diddi- commented 4 years ago

Thanks for opening this PR. It makes sense that ordering matters sometimes so I think this is a good addition.

Could you please also update the docstring for get_seeders() to mention it returns ordered seeders based on priority as well as the README to describe how to use this feature, and I'll be happy to merge this.

wakemaster39 commented 4 years ago

updated the documentation as requested.

diddi- commented 4 years ago

Thanks!