From 978fd3149cf3124302f5aebff732d48dd0c4b09b Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 17 Oct 2024 16:40:56 +0200 Subject: [PATCH] Make TESTed the defaul 'default judge' for repositories --- app/models/repository.rb | 2 +- .../20241017143229_set_default_judge_for_repositories.rb | 5 +++++ db/schema.rb | 4 ++-- test/factories/repositories.rb | 2 +- test/models/repository_test.rb | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20241017143229_set_default_judge_for_repositories.rb diff --git a/app/models/repository.rb b/app/models/repository.rb index d5e16561f8..fcd5cadeb2 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -6,7 +6,7 @@ # name :string(255) # remote :string(255) # path :string(255) -# judge_id :integer +# judge_id :integer default(17) # created_at :datetime not null # updated_at :datetime not null # clone_status :integer default("queued"), not null diff --git a/db/migrate/20241017143229_set_default_judge_for_repositories.rb b/db/migrate/20241017143229_set_default_judge_for_repositories.rb new file mode 100644 index 0000000000..ac614c4c01 --- /dev/null +++ b/db/migrate/20241017143229_set_default_judge_for_repositories.rb @@ -0,0 +1,5 @@ +class SetDefaultJudgeForRepositories < ActiveRecord::Migration[7.2] + def change + change_column_default :repositories, :judge_id, from: nil, to: 17 + end +end diff --git a/db/schema.rb b/db/schema.rb index 1afaa8229c..270ddcaeae 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2024_09_11_085152) do +ActiveRecord::Schema[7.2].define(version: 2024_10_17_143229) do create_table "active_storage_attachments", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.string "name", null: false t.string "record_type", null: false @@ -390,7 +390,7 @@ t.string "name" t.string "remote" t.string "path" - t.integer "judge_id" + t.integer "judge_id", default: 17 t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false t.integer "clone_status", default: 1, null: false diff --git a/test/factories/repositories.rb b/test/factories/repositories.rb index 7f45ca9bfa..a8a3cc844a 100644 --- a/test/factories/repositories.rb +++ b/test/factories/repositories.rb @@ -6,7 +6,7 @@ # name :string(255) # remote :string(255) # path :string(255) -# judge_id :integer +# judge_id :integer default(17) # created_at :datetime not null # updated_at :datetime not null # clone_status :integer default("queued"), not null diff --git a/test/models/repository_test.rb b/test/models/repository_test.rb index 8aad82d1a6..e29a2379f0 100644 --- a/test/models/repository_test.rb +++ b/test/models/repository_test.rb @@ -6,7 +6,7 @@ # name :string(255) # remote :string(255) # path :string(255) -# judge_id :integer +# judge_id :integer default(17) # created_at :datetime not null # updated_at :datetime not null # clone_status :integer default("queued"), not null