diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-16 18:08:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-16 18:08:22 +0000 |
commit | 123c68a7cf788ace140e57e478a12c5b7ac893ae (patch) | |
tree | b36e565ecd895ee46c1713f3734308cfce0e6ba9 /db | |
parent | 862d225ca0d8eb452e56b8fe5a0109aac796e872 (diff) | |
download | gitlab-ce-123c68a7cf788ace140e57e478a12c5b7ac893ae.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20191128145231_add_ci_resource_groups.rb | 24 | ||||
-rw-r--r-- | db/migrate/20191129144631_add_index_to_resource_group_id.rb | 20 | ||||
-rw-r--r-- | db/schema.rb | 24 |
3 files changed, 0 insertions, 68 deletions
diff --git a/db/migrate/20191128145231_add_ci_resource_groups.rb b/db/migrate/20191128145231_add_ci_resource_groups.rb deleted file mode 100644 index 0b730e47dda..00000000000 --- a/db/migrate/20191128145231_add_ci_resource_groups.rb +++ /dev/null @@ -1,24 +0,0 @@ -# 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 diff --git a/db/migrate/20191129144631_add_index_to_resource_group_id.rb b/db/migrate/20191129144631_add_index_to_resource_group_id.rb deleted file mode 100644 index 0e5a84f094d..00000000000 --- a/db/migrate/20191129144631_add_index_to_resource_group_id.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToResourceGroupId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_for_resource_group'.freeze - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_builds, %i[resource_group_id id], where: 'resource_group_id IS NOT NULL', name: INDEX_NAME - add_concurrent_foreign_key :ci_builds, :ci_resource_groups, column: :resource_group_id, on_delete: :nullify - end - - def down - remove_foreign_key_if_exists :ci_builds, column: :resource_group_id - remove_concurrent_index_by_name :ci_builds, INDEX_NAME - end -end diff --git a/db/schema.rb b/db/schema.rb index 88c824cb708..ede50e7ed06 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -684,8 +684,6 @@ ActiveRecord::Schema.define(version: 2019_12_08_071112) do t.datetime_with_timezone "scheduled_at" t.string "token_encrypted" t.integer "upstream_pipeline_id" - t.bigint "resource_group_id" - t.datetime_with_timezone "waiting_for_resource_at" 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])))" @@ -699,7 +697,6 @@ ActiveRecord::Schema.define(version: 2019_12_08_071112) do t.index ["project_id"], name: "index_ci_builds_on_project_id_for_successfull_pages_deploy", where: "(((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text))" t.index ["protected"], name: "index_ci_builds_on_protected" t.index ["queued_at"], name: "index_ci_builds_on_queued_at" - t.index ["resource_group_id", "id"], name: "index_for_resource_group", where: "(resource_group_id IS NOT NULL)" t.index ["runner_id"], name: "index_ci_builds_on_runner_id" t.index ["scheduled_at"], name: "partial_index_ci_builds_on_scheduled_at_with_scheduled_jobs", where: "((scheduled_at IS NOT NULL) AND ((type)::text = 'Ci::Build'::text) AND ((status)::text = 'scheduled'::text))" t.index ["stage_id", "stage_idx"], name: "tmp_build_stage_position_index", where: "(stage_idx IS NOT NULL)" @@ -874,23 +871,6 @@ ActiveRecord::Schema.define(version: 2019_12_08_071112) do t.index ["user_id"], name: "index_ci_pipelines_on_user_id" end - create_table "ci_resource_groups", force: :cascade do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.bigint "project_id", null: false - t.string "key", limit: 255, null: false - t.index ["project_id", "key"], name: "index_ci_resource_groups_on_project_id_and_key", unique: true - end - - create_table "ci_resources", force: :cascade do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.bigint "resource_group_id", null: false - t.bigint "build_id" - t.index ["build_id"], name: "index_ci_resources_on_build_id" - t.index ["resource_group_id", "build_id"], name: "index_ci_resources_on_resource_group_id_and_build_id", unique: true - end - create_table "ci_runner_namespaces", id: :serial, force: :cascade do |t| t.integer "runner_id" t.integer "namespace_id" @@ -4409,7 +4389,6 @@ ActiveRecord::Schema.define(version: 2019_12_08_071112) do add_foreign_key "ci_builds", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_a2141b1522", on_delete: :nullify add_foreign_key "ci_builds", "ci_pipelines", column: "commit_id", name: "fk_d3130c9a7f", on_delete: :cascade add_foreign_key "ci_builds", "ci_pipelines", column: "upstream_pipeline_id", name: "fk_87f4cefcda", on_delete: :cascade - add_foreign_key "ci_builds", "ci_resource_groups", column: "resource_group_id", name: "fk_6661f4f0e8", on_delete: :nullify add_foreign_key "ci_builds", "ci_stages", column: "stage_id", name: "fk_3a9eaa254d", on_delete: :cascade add_foreign_key "ci_builds", "projects", name: "fk_befce0568a", on_delete: :cascade add_foreign_key "ci_builds_metadata", "ci_builds", column: "build_id", on_delete: :cascade @@ -4430,9 +4409,6 @@ ActiveRecord::Schema.define(version: 2019_12_08_071112) do add_foreign_key "ci_pipelines", "external_pull_requests", name: "fk_190998ef09", on_delete: :nullify add_foreign_key "ci_pipelines", "merge_requests", name: "fk_a23be95014", on_delete: :cascade add_foreign_key "ci_pipelines", "projects", name: "fk_86635dbd80", on_delete: :cascade - add_foreign_key "ci_resource_groups", "projects", on_delete: :cascade - add_foreign_key "ci_resources", "ci_builds", column: "build_id", on_delete: :nullify - add_foreign_key "ci_resources", "ci_resource_groups", column: "resource_group_id", on_delete: :cascade add_foreign_key "ci_runner_namespaces", "ci_runners", column: "runner_id", on_delete: :cascade add_foreign_key "ci_runner_namespaces", "namespaces", on_delete: :cascade add_foreign_key "ci_runner_projects", "projects", name: "fk_4478a6f1e4", on_delete: :cascade |