Skip to content

Commit

Permalink
Add NOT NULL constraints to all job_id columns
Browse files Browse the repository at this point in the history
  • Loading branch information
rosa committed Oct 30, 2023
1 parent 5787092 commit 722c99b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions db/migrate/20231030164933_make_job_id_not_null.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class MakeJobIdNotNull < ActiveRecord::Migration[7.1]
def change
change_column :solid_queue_claimed_executions, :job_id, :bigint, null: false
change_column :solid_queue_failed_executions, :job_id, :bigint, null: false
change_column :solid_queue_ready_executions, :job_id, :bigint, null: false
change_column :solid_queue_scheduled_executions, :job_id, :bigint, null: false
end
end
10 changes: 5 additions & 5 deletions test/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2023_10_25_165946) do
ActiveRecord::Schema[7.1].define(version: 2023_10_30_164933) do
create_table "job_results", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "queue_name"
t.string "status"
Expand All @@ -20,15 +20,15 @@
end

create_table "solid_queue_claimed_executions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "job_id"
t.bigint "job_id", null: false
t.bigint "process_id"
t.datetime "created_at", null: false
t.index ["job_id"], name: "index_solid_queue_claimed_executions_on_job_id", unique: true
t.index ["process_id"], name: "index_solid_queue_claimed_executions_on_process_id"
end

create_table "solid_queue_failed_executions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "job_id"
t.bigint "job_id", null: false
t.text "error"
t.datetime "created_at", null: false
t.index ["job_id"], name: "index_solid_queue_failed_executions_on_job_id", unique: true
Expand Down Expand Up @@ -63,7 +63,7 @@
end

create_table "solid_queue_ready_executions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "job_id"
t.bigint "job_id", null: false
t.string "queue_name", null: false
t.integer "priority", default: 0, null: false
t.datetime "created_at", null: false
Expand All @@ -73,7 +73,7 @@
end

create_table "solid_queue_scheduled_executions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "job_id"
t.bigint "job_id", null: false
t.string "queue_name", null: false
t.integer "priority", default: 0, null: false
t.datetime "scheduled_at", null: false
Expand Down

0 comments on commit 722c99b

Please sign in to comment.