diff --git a/db/migrate/20180508135515_set_runner_type_not_null.rb b/db/migrate/20180508135515_set_runner_type_not_null.rb new file mode 100644 index 0000000000000000000000000000000000000000..dd043ec7179d349dd36e589f201b0b21a6ace61f --- /dev/null +++ b/db/migrate/20180508135515_set_runner_type_not_null.rb @@ -0,0 +1,9 @@ +class SetRunnerTypeNotNull < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + change_column_null(:ci_runners, :runner_type, false) + end +end diff --git a/db/schema.rb b/db/schema.rb index 6fd10785d77aefb273e05cb52f2a5a047bcaae17..839a5f6699ac711efe35277bf272881894de3bdc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180508055821) do +ActiveRecord::Schema.define(version: 20180508135515) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -497,7 +497,7 @@ ActiveRecord::Schema.define(version: 20180508055821) do t.integer "access_level", default: 0, null: false t.string "ip_address" t.integer "maximum_timeout" - t.integer "runner_type", limit: 2 + t.integer "runner_type", limit: 2, null: false end add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree diff --git a/spec/factories/ci/runners.rb b/spec/factories/ci/runners.rb index 34b8b246d0fc0bfbb83372073e72934225796254..cdc170b9ccb890884805a318b50a7925c26ae7e3 100644 --- a/spec/factories/ci/runners.rb +++ b/spec/factories/ci/runners.rb @@ -6,6 +6,7 @@ FactoryBot.define do is_shared false active true access_level :not_protected + runner_type :project_type trait :online do contacted_at Time.now @@ -13,6 +14,7 @@ FactoryBot.define do trait :shared do is_shared true + runner_type :instance_type end trait :specific do