Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-12 09:07:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-12 09:07:42 +0300
commit8e22ef10e4f9c6d1ef2411aa26ddd0658e2f1461 (patch)
tree1ffd5ffed59b0f752fc358524f4d2170f6694cb9 /db/migrate/20191128145231_add_ci_resource_groups.rb
parent2ccde70b80730fd52f75797e7d711748fb5b769b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20191128145231_add_ci_resource_groups.rb')
-rw-r--r--db/migrate/20191128145231_add_ci_resource_groups.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/db/migrate/20191128145231_add_ci_resource_groups.rb b/db/migrate/20191128145231_add_ci_resource_groups.rb
new file mode 100644
index 00000000000..0b730e47dda
--- /dev/null
+++ b/db/migrate/20191128145231_add_ci_resource_groups.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class AddCiResourceGroups < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ def change
+ create_table :ci_resource_groups do |t|
+ t.timestamps_with_timezone
+ t.references :project, null: false, index: false, foreign_key: { on_delete: :cascade }
+ t.string :key, null: false, limit: 255
+ t.index %i[project_id key], unique: true
+ end
+
+ create_table :ci_resources do |t|
+ t.timestamps_with_timezone
+ t.references :resource_group, null: false, index: false, foreign_key: { to_table: :ci_resource_groups, on_delete: :cascade }
+ t.references :build, null: true, index: true, foreign_key: { to_table: :ci_builds, on_delete: :nullify }
+ t.index %i[resource_group_id build_id], unique: true
+ end
+
+ add_column :ci_builds, :resource_group_id, :bigint
+ add_column :ci_builds, :waiting_for_resource_at, :datetime_with_timezone
+ end
+end