Closed mhenrixon closed 2 months ago
The migration was introduced in v3.29.0 (#999).
If you recently upgraded to GoodJob v4, you'll need to go to version 3.99
and run bundle exec rails g good_job:update
and apply and deploy those migrations, then upgrade to v4.
Oh, that explains things! I didn't see that I bumped a major version! Thank you for the quick reply.
im getting this error on 4.0.0, but nothing meaningful happens when I run the update command.
11:10 ~/Sites/backend [dependabot/bundler/good_job-4.0.0] $ bundle exec rails g good_job:update
skip db/migrate/20240709151103_create_good_jobs.rb
ran bundle install and restarted everything. I get this error when I visit the processes tab of the admin:
Showing /Users/jacob/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/good_job-4.0.0/app/views/good_job/processes/index.html.erb where line #21 raised:
PG::UndefinedColumn: ERROR: column good_job_processes.lock_type does not exist
LINE 1: ...xt), 1, 16))::bit(64) << 32)::bit(32)::int WHERE ("good_job_...
^
Rails.root: /Users/jacob/Sites/backend
and a similar one on performance:
Showing /Users/jacob/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/good_job-4.0.0/app/views/good_job/performances/show.html.erb where line #18 raised:
PG::UndefinedColumn: ERROR: column "duration" does not exist
LINE 4: AVG(duration) AS avg_duration,
^
Rails.root: /Users/jacob/Sites/backend
here are all the good_job related migrations I have:
It looks like you didn't generate and run all of the migrations on v3.99.
(I squash all of the migrations every new release. That's so that someone adopting GoodJob for the first time doesn't have to generate like 40 migration files all at once.)
You should point your gemfile to 3.99, then run bin/rails g good_job:update
to get the migrations.
yup, that was it! I wonder if you could somehow detect that? or squash them one version later perhaps. I see now the docs do list it in that order, but totally missed that.
11:30 ~/Sites/backend [main] $ bundle exec rails g good_job:update
skip db/migrate/20240709155228_create_good_jobs.rb
identical db/migrate/20240117153100_create_good_job_settings.rb
identical db/migrate/20240117153101_create_index_good_jobs_jobs_on_priority_created_at_when_unfinished.rb
identical db/migrate/20240117153102_create_good_job_batches.rb
identical db/migrate/20240117153103_create_good_job_executions.rb
identical db/migrate/20240117153104_create_good_jobs_error_event.rb
identical db/migrate/20240117153105_recreate_good_job_cron_indexes_with_conditional.rb
identical db/migrate/20240117153106_create_good_job_labels.rb
identical db/migrate/20240117153107_create_good_job_labels_index.rb
identical db/migrate/20240117153108_remove_good_job_active_id_index.rb
identical db/migrate/20240520135504_create_index_good_job_jobs_for_candidate_lookup.rb
identical db/migrate/20240520135505_create_good_job_execution_error_backtrace.rb
create db/migrate/20240709155229_create_good_job_process_lock_ids.rb
create db/migrate/20240709155230_create_good_job_process_lock_indexes.rb
create db/migrate/20240709155723_create_good_job_execution_duration.rb
thanks!
Started having these errors in my logs:
I can't make sense of it or find any information to suggest what is wrong. Any whelp appreciated.