Open pave-epti opened 4 years ago
From my point of view, seeds are not the right way to create data. Instead, I would like to propose something like conditional migrations. I would like just use an env or config to run the "right" migrations.
Hey folks :wave:
These are pretty big pieces of functionality. Will agree that in practice the seeds don't work out well without the ability to auto-apply from .cli-migrations
image and not re-apply once run.
Will put this on the todo and see if someone from the CLI team can get to it soonish.
I also find this feature very useful. It would be great to get it in upcoming versions
The sort of understanding I have for "seeding" is
So, if we encounter a use case for something which we feel must be tracked like migrations, then maybe it should be treated as migration itself?
Seeders are added in v1.3.0. It is a good start, but they are pretty basic and have shortcomings:
In v1.3.0 release notes, there is a sentence which tells me there is intention for making smart seeders because they are called seed migrations, not only seeds.
So currently, if some necessary data needs to be seeded which will be the same for all environments, it is still better to use migrations and manually write up.sql and down.sql.
It would be also be nice to have a flag to force re-execution of the seed file, even if it is already executed and tracked in seed_migrations db table.