Level 74
You have ovethought the whole thing, Just use a simple SQLite db on the local host instead, or set up a permanent container. Stop using all those fancy kubernetes things, they will only make you get wird issues like this one.
Hi I’m using Laravel with docker swarm (or with kubernetes); to simplify my problem, consider that we have two containers:
the problem is that when the MySQL container crashes and will be restarted by the orchestrator, It doesn’t contain the migrations because the DB is empty.
To solve that I’ve simply added into app/Console/Kernel.php the code:
$schedule->command('migrate')
->name('schedule__migrate')
->withoutOverlapping()
->everyMinute();
it works but the question is; is this the best practice to run migration when the MySQL restarts?
Thank you.
Please or to participate in this conversation.