bensheldon/good_job · error

GoodJob has pending database migrations. To create the migra

Error message

GoodJob has pending database migrations. To create the migration files, run:
    rails generate good_job:update
To apply the migration files, run:
    rails db:migrate

What it means

Error "GoodJob has pending database migrations. To create the migration files, run: rails generate good_job:update To apply the migration files, run: rails db:migrate" thrown in bensheldon/good_job.

Source

Thrown at app/models/good_job/base_record.rb:13

# frozen_string_literal: true

module GoodJob
  # Base ActiveRecord class that all GoodJob models inherit from.
  # Parent class can be configured with +GoodJob.active_record_parent_class+.
  # @!parse
  #   class BaseRecord < ActiveRecord::Base; end
  class BaseRecord < ActiveRecordParentClass
    self.abstract_class = true
    self.strict_loading_by_default = false

    def self.migration_pending_warning!
      GoodJob.deprecator.warn(<<~DEPRECATION)
        GoodJob has pending database migrations. To create the migration files, run:
            rails generate good_job:update
        To apply the migration files, run:
            rails db:migrate
      DEPRECATION
      nil
    end

    # Checks for whether the schema is up to date.
    # Can be overriden by child class.
    # @return [Boolean]
    def self.migrated?
      return true if table_exists?

      migration_pending_warning!
      false
    end

View on GitHub (pinned to 5fcde48f87)

Solutions

  1. Generate the pending GoodJob update migrations and apply them.
  2. Run rails generate good_job:update, then rails db:migrate.

Example fix

bin/rails generate good_job:update
bin/rails db:migrate

When it happens

Trigger: Thrown at app/models/good_job/base_record.rb:13 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bensheldon/good_job@5fcde48f87 (2026-08-23). Data as JSON: /api/errors/3fc669586fd18797. Report an issue: GitHub.