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>2019-11-13 15:06:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-13 15:06:22 +0300
commit4e516dbff9767a35677fdc4a6e39005b4b564376 (patch)
tree7c650b30777b8e7f72cafb186e9446a50d3fa3be /db
parent4f01ac5ba0bf72427ed4fef9b229d056dbb60e89 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20191112214305_add_indexes_for_projects_api_default_params.rb19
-rw-r--r--db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb27
-rw-r--r--db/schema.rb4
3 files changed, 24 insertions, 26 deletions
diff --git a/db/migrate/20191112214305_add_indexes_for_projects_api_default_params.rb b/db/migrate/20191112214305_add_indexes_for_projects_api_default_params.rb
new file mode 100644
index 00000000000..3893c0422c7
--- /dev/null
+++ b/db/migrate/20191112214305_add_indexes_for_projects_api_default_params.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddIndexesForProjectsApiDefaultParams < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :projects, %i(visibility_level created_at id)
+ remove_concurrent_index_by_name :projects, 'index_projects_on_visibility_level'
+ end
+
+ def down
+ add_concurrent_index :projects, :visibility_level
+ remove_concurrent_index :projects, %i(visibility_level created_at id)
+ end
+end
diff --git a/db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb b/db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb
index 4a1eda130f9..fc44568ea17 100644
--- a/db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb
+++ b/db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb
@@ -3,34 +3,13 @@
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
-# TODO: remove this migration after execution on gitlab.com https://gitlab.com/gitlab-org/gitlab/issues/34018
+# Code of this migration was removed after execution on gitlab.com
+# https://gitlab.com/gitlab-org/gitlab/issues/34018
+# Empty migration is left here to avoid any problems with rolling back
class ScheduleFixGitlabComPagesAccessLevel < ActiveRecord::Migration[5.2]
- include Gitlab::Database::MigrationHelpers
-
DOWNTIME = false
- MIGRATION = 'FixGitlabComPagesAccessLevel'
- BATCH_SIZE = 20_000
- BATCH_TIME = 2.minutes
-
- # Project
- class Project < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'projects'
- self.inheritance_column = :_type_disabled
- end
-
- disable_ddl_transaction!
-
def up
- return unless ::Gitlab.com?
-
- queue_background_migration_jobs_by_range_at_intervals(
- Project,
- MIGRATION,
- BATCH_TIME,
- batch_size: BATCH_SIZE)
end
def down
diff --git a/db/schema.rb b/db/schema.rb
index 237febdef25..9404ec6779f 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_11_12_115317) do
+ActiveRecord::Schema.define(version: 2019_11_12_214305) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@@ -3145,7 +3145,7 @@ ActiveRecord::Schema.define(version: 2019_11_12_115317) do
t.index ["runners_token"], name: "index_projects_on_runners_token"
t.index ["runners_token_encrypted"], name: "index_projects_on_runners_token_encrypted"
t.index ["star_count"], name: "index_projects_on_star_count"
- t.index ["visibility_level"], name: "index_projects_on_visibility_level"
+ t.index ["visibility_level", "created_at", "id"], name: "index_projects_on_visibility_level_and_created_at_and_id"
end
create_table "prometheus_alert_events", force: :cascade do |t|