summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 06:09:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 06:09:05 +0000
commit8c9dc985b90c353b33cb829caf51f8320171bc15 (patch)
tree9a68886dbea1aefabddb46bbd3faf961eab22ae6 /db
parent500626a5c953ad81cfc3ed74bf0148c075617e58 (diff)
downloadgitlab-ce-8c9dc985b90c353b33cb829caf51f8320171bc15.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/fixtures/development/14_pipelines.rb5
-rw-r--r--db/migrate/20191223124940_add_scheduling_type_to_ci_builds.rb11
-rw-r--r--db/schema.rb1
3 files changed, 15 insertions, 2 deletions
diff --git a/db/fixtures/development/14_pipelines.rb b/db/fixtures/development/14_pipelines.rb
index 417a68d6ad7..7a9b97dfefa 100644
--- a/db/fixtures/development/14_pipelines.rb
+++ b/db/fixtures/development/14_pipelines.rb
@@ -165,9 +165,10 @@ class Gitlab::Seeder::Pipelines
end
def job_attributes(pipeline, opts)
- { name: 'test build', stage: 'test', stage_idx: stage_index(opts[:stage]),
+ {
+ name: 'test build', stage: 'test', stage_idx: stage_index(opts[:stage]),
ref: pipeline.ref, tag: false, user: build_user, project: @project, pipeline: pipeline,
- created_at: Time.now, updated_at: Time.now
+ scheduling_type: :stage, created_at: Time.now, updated_at: Time.now
}.merge(opts)
end
diff --git a/db/migrate/20191223124940_add_scheduling_type_to_ci_builds.rb b/db/migrate/20191223124940_add_scheduling_type_to_ci_builds.rb
new file mode 100644
index 00000000000..0cb42cdc328
--- /dev/null
+++ b/db/migrate/20191223124940_add_scheduling_type_to_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddSchedulingTypeToCiBuilds < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ add_column :ci_builds, :scheduling_type, :integer, limit: 2
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index a6c2edabeaf..07ff6ff0828 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -677,6 +677,7 @@ ActiveRecord::Schema.define(version: 2020_02_11_152410) do
t.bigint "resource_group_id"
t.datetime_with_timezone "waiting_for_resource_at"
t.boolean "processed"
+ t.integer "scheduling_type", limit: 2
t.index ["artifacts_expire_at"], name: "index_ci_builds_on_artifacts_expire_at", where: "(artifacts_file <> ''::text)"
t.index ["auto_canceled_by_id"], name: "index_ci_builds_on_auto_canceled_by_id"
t.index ["commit_id", "artifacts_expire_at", "id"], name: "index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial", where: "(((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('sast:container'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])))"