zammad-docker-compose
zammad-docker-compose copied to clipboard
Duplicate seed run
Infos
- Docker version: 20.10.17
- Operating system (Docker host): debian
Actual behavior
After upgrading zammad from 5.1 -> 5.2 I noticed that some settings rolled back to initial values (triggers, calendar, email notification). My guess is that db:seed executed a second time.
Steps to reproduce the behavior
I don't have specific steps, migration from 5.2.0 -> 5.2.1 didn't cause any issues.
But after looking into code I noticed that this code will will run seed second time if there any issues:
if ! (bundle exec rails r 'puts User.any?' 2> /dev/null | grep -q true); then
For example code below fill print seed:
bash -ec 'if ! (bundle exec rails r "raise" 2> /dev/null | grep -q true); then echo seed; else echo migrate; fi
Safer option would be to replace something like this:
if [[ $(bundle exec rails r "puts User.any?") = *false ]] ; then