-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
class CreateGoodJobExecutions < ActiveRecord::Migration[7.0] | ||
def change | ||
reversible do |dir| | ||
dir.up do | ||
# Ensure this incremental update migration is idempotent | ||
# with monolithic install migration. | ||
return if connection.table_exists?(:good_job_executions) | ||
end | ||
end | ||
|
||
create_table :good_job_executions, id: :uuid do |t| | ||
t.timestamps | ||
|
||
t.uuid :active_job_id, null: false | ||
t.text :job_class | ||
t.text :queue_name | ||
t.jsonb :serialized_params | ||
t.datetime :scheduled_at | ||
t.datetime :finished_at | ||
t.text :error | ||
|
||
t.index %i[active_job_id created_at], name: :index_good_job_executions_on_active_job_id_and_created_at | ||
end | ||
|
||
change_table :good_jobs do |t| # rubocop:disable Rails/BulkChangeTable | ||
t.boolean :is_discrete # rubocop:disable Rails/ThreeStateBooleanColumn | ||
t.integer :executions_count | ||
t.text :job_class | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
class CreateGoodJobsErrorEvent < ActiveRecord::Migration[7.0] | ||
def change | ||
reversible do |dir| | ||
dir.up do | ||
# Ensure this incremental update migration is idempotent | ||
# with monolithic install migration. | ||
return if connection.column_exists?(:good_jobs, :error_event) | ||
end | ||
end | ||
|
||
add_column :good_jobs, :error_event, :integer, limit: 2 | ||
add_column :good_job_executions, :error_event, :integer, limit: 2 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters