I would like to automatically create a test schema in the mysql sail database container, to sit alongside the main database. Are there any hints on how this can be done? There are so many layers to the docker/compose/sail architecture, it's difficult to know where the best place is to start.
For example, I know I can create a schema in the container through the CLI. So can I run that automatically when the container starts? Do I need to extend the docker file to do this, or can docker-composer.yaml run it? Is there already a command in the container that will create a database if it does not already exist (I guess there is, since that's what the container does, or is it sail which does that?) and can I lerage that? Will it in the end just be easier to run a command by hand, once, after starting sail for the first time? So many choices, and so many layers - the more I know, the more I know I don' know. Looking for the one that just works when pulling the project and starting it up through sail.
I've noticed that the latest sail now does this automaticallty - it creates a testing database alongside the main database you create. It is done through a line in the volumes section of docker-compose.yaml:
Presumably you coud add as many databases as you line during creation using the same technique. Also not sure if the database is in permanent storage or not - will experiment.
Glad it wasn't just me wanting this feature, seeing as it is now part of core Laravel sail.