zammad-docker-compose icon indicating copy to clipboard operation
zammad-docker-compose copied to clipboard

Duplicate seed run

Open valodzka opened this issue 3 years ago • 0 comments

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

valodzka avatar Jul 13 '22 12:07 valodzka