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
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-02 16:03:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-02 16:03:23 +0300
commita72a9af092c1bfcf9f8024d59c11cf222f07e1e7 (patch)
tree44b60265c1d476d026b2862d2c1244748f558d4f /db
parentb085478c4c2bed74fdc6eb2c33bfc62e791baf03 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20191210211253_create_resource_weight_event.rb18
-rw-r--r--db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb17
-rw-r--r--db/schema.rb14
3 files changed, 47 insertions, 2 deletions
diff --git a/db/migrate/20191210211253_create_resource_weight_event.rb b/db/migrate/20191210211253_create_resource_weight_event.rb
new file mode 100644
index 00000000000..b458c5f169f
--- /dev/null
+++ b/db/migrate/20191210211253_create_resource_weight_event.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateResourceWeightEvent < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ def change
+ create_table :resource_weight_events do |t|
+ t.references :user, null: false, foreign_key: { on_delete: :nullify },
+ index: { name: 'index_resource_weight_events_on_user_id' }
+ t.references :issue, null: false, foreign_key: { on_delete: :cascade },
+ index: false
+ t.integer :weight
+ t.datetime_with_timezone :created_at, null: false
+
+ t.index [:issue_id, :weight], name: 'index_resource_weight_events_on_issue_id_and_weight'
+ end
+ end
+end
diff --git a/db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb b/db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb
new file mode 100644
index 00000000000..dbfe3758cda
--- /dev/null
+++ b/db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class DropIndexCiPipelinesOnProjectId < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index :ci_pipelines, :project_id
+ end
+
+ def down
+ add_concurrent_index :ci_pipelines, :project_id
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 219ac8c5263..2f9c5fa8f5a 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.define(version: 2019_12_18_225624) do
+ActiveRecord::Schema.define(version: 2019_12_29_140154) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@@ -871,7 +871,6 @@ ActiveRecord::Schema.define(version: 2019_12_18_225624) do
t.index ["project_id", "source"], name: "index_ci_pipelines_on_project_id_and_source"
t.index ["project_id", "status", "config_source"], name: "index_ci_pipelines_on_project_id_and_status_and_config_source"
t.index ["project_id", "status", "updated_at"], name: "index_ci_pipelines_on_project_id_and_status_and_updated_at"
- t.index ["project_id"], name: "index_ci_pipelines_on_project_id"
t.index ["status"], name: "index_ci_pipelines_on_status"
t.index ["user_id"], name: "index_ci_pipelines_on_user_id"
end
@@ -3605,6 +3604,15 @@ ActiveRecord::Schema.define(version: 2019_12_18_225624) do
t.index ["user_id"], name: "index_resource_label_events_on_user_id"
end
+ create_table "resource_weight_events", force: :cascade do |t|
+ t.bigint "user_id", null: false
+ t.bigint "issue_id", null: false
+ t.integer "weight"
+ t.datetime_with_timezone "created_at", null: false
+ t.index ["issue_id", "weight"], name: "index_resource_weight_events_on_issue_id_and_weight"
+ t.index ["user_id"], name: "index_resource_weight_events_on_user_id"
+ end
+
create_table "reviews", force: :cascade do |t|
t.integer "author_id"
t.integer "merge_request_id", null: false
@@ -4745,6 +4753,8 @@ ActiveRecord::Schema.define(version: 2019_12_18_225624) do
add_foreign_key "resource_label_events", "labels", on_delete: :nullify
add_foreign_key "resource_label_events", "merge_requests", on_delete: :cascade
add_foreign_key "resource_label_events", "users", on_delete: :nullify
+ add_foreign_key "resource_weight_events", "issues", on_delete: :cascade
+ add_foreign_key "resource_weight_events", "users", on_delete: :nullify
add_foreign_key "reviews", "merge_requests", on_delete: :cascade
add_foreign_key "reviews", "projects", on_delete: :cascade
add_foreign_key "reviews", "users", column: "author_id", on_delete: :nullify