I am using symfony 4.2 and looking for a way to insert initial data to the database. What I was trying to create is something like an initial setup script that do some sql inserts (like fixtures but for the production environment as well) that can be called by a console command.
I was thinking of using the postUp function in the doctrine migration class but I don’t want to rewrite this function for every production environment I set up. Is there a way to use doctrines migration functionality for this purpose or is there a preferred way?
Example workflow:
- Install symfony by cloning the git repository
- Execute migrations to create / update the database tables
- Execute the setup script to insert the needed default values into the database tables