Browse Source

Follow-up: 180bc4a - Fix waiting in docker image

Martin Gruner 3 months ago
parent
commit
f9682ab28d

+ 1 - 1
.gitlab/ci/test/migration.yml

@@ -20,7 +20,7 @@
     # Force redis usage, even if it was disabled by the initial configure_environment script of stable.
     - export REDIS_URL=redis://redis
     - bundle exec rails db:migrate
-    - bundle exec rspec --profile 10 spec/db -t ~searchindex
+    - RAILS_CHECK_PENDING_MIGRATIONS=1 bundle exec rspec --profile 10 spec/db -t ~searchindex
 
 rspec:migration:postgresql:
   extends:

+ 1 - 1
config/initializers/active_record_pending_migrations.rb

@@ -1,5 +1,5 @@
 # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
 
 if %w[1 true].include? ENV['RAILS_CHECK_PENDING_MIGRATIONS']
-  ActiveRecord::Migration.check_pending!
+  ActiveRecord::Migration.check_all_pending!
 end

+ 1 - 1
contrib/docker/docker-entrypoint.sh

@@ -36,7 +36,7 @@ export DATABASE_URL="postgres://${POSTGRESQL_USER}:${ESCAPED_POSTGRESQL_PASS}@${
 
 function check_zammad_ready {
   # Verify that migrations have been ran and seeds executed to process ENV vars like FQDN correctly.
-  until bundle exec rails r 'ActiveRecord::Migration.check_pending!; Locale.any? || raise' &> /dev/null; do
+  until bundle exec rails r 'ActiveRecord::Migration.check_all_pending!; Locale.any? || raise' &> /dev/null; do
     echo "waiting for init container to finish install or update..."
     sleep 5
   done