You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.
I guess my only concern is if a new developer joins this project and they need to create/migrate their local DB or anytime you blow away your current DB and start fresh (which I personally do every time I seed/migrate my DB which happens quite often) you will run these migrations which will seed the DB. This is because you start from a brand new DB and need to run every single migration since the projects inception. Which means you technically have to keep this up to date as well. So you will have to keep db/migrate/202002/circulation_rule.yml file in this repo forever and this seeding script in working condition or else this migration will fail.
Maybe why it's rare to see complicated seeding or other scripts in migration files as you want to keep migrations for simply schema changes or change existing data.
If it's a one time thing that we want for production, then maybe that should be a temporary rake task which gets ran once in production to seed the new tables. Then afterwards we can remove these files and the rake task and never have to think about this stuff again. If its not a one time thing and this is data that is required for the app (e.g you have a dropdown menu on a form populated from a DB table), then that should be in the seeds.
I suppose the other option is leave these how they are. After they get ran in production, come back and cleanup all the scripts for seeding in these migrations and remove the yaml files? This could work too and removes my concerns. Plus could make Unix team job easier then having them run one time rake task
I guess my only concern is if a new developer joins this project and they need to create/migrate their local DB or anytime you blow away your current DB and start fresh (which I personally do every time I seed/migrate my DB which happens quite often) you will run these migrations which will seed the DB. This is because you start from a brand new DB and need to run every single migration since the projects inception. Which means you technically have to keep this up to date as well. So you will have to keep db/migrate/202002/circulation_rule.yml file in this repo forever and this seeding script in working condition or else this migration will fail.
Maybe why it's rare to see complicated seeding or other scripts in migration files as you want to keep migrations for simply schema changes or change existing data.
If it's a one time thing that we want for production, then maybe that should be a temporary rake task which gets ran once in production to seed the new tables. Then afterwards we can remove these files and the rake task and never have to think about this stuff again. If its not a one time thing and this is data that is required for the app (e.g you have a dropdown menu on a form populated from a DB table), then that should be in the seeds.
#343 (comment)
I suppose the other option is leave these how they are. After they get ran in production, come back and cleanup all the scripts for seeding in these migrations and remove the yaml files? This could work too and removes my concerns. Plus could make Unix team job easier then having them run one time rake task
#343 (comment)
The text was updated successfully, but these errors were encountered: