summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorEugene Howe <eugene@xtreme-computers.net>2016-07-17 10:32:11 -0400
committerEugene Howe <eugene@xtreme-computers.net>2016-07-19 09:06:58 -0400
commit13e74543f9d0f91b7b3ef14279fd78d83f442750 (patch)
tree2113950412eb9a83d3f0bc5bdc1aaee60661e06c /db
parent61e7453e0465ceb631d3e8445429cfed7c1449d3 (diff)
downloadgitlab-ce-13e74543f9d0f91b7b3ef14279fd78d83f442750.tar.gz
speed up ExternalWikiService#get_project_wiki_path
* This method previously iterated over all services in a project. Now it will directly query the ExternalWikiService for the project and filter by active state. * The presence of an external wiki is also cached * When an external wiki is added or removed, the cached value is updated
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160718153603_add_has_external_wiki_to_projects.rb7
-rw-r--r--db/schema.rb3
2 files changed, 9 insertions, 1 deletions
diff --git a/db/migrate/20160718153603_add_has_external_wiki_to_projects.rb b/db/migrate/20160718153603_add_has_external_wiki_to_projects.rb
new file mode 100644
index 00000000000..55a3e954292
--- /dev/null
+++ b/db/migrate/20160718153603_add_has_external_wiki_to_projects.rb
@@ -0,0 +1,7 @@
+class AddHasExternalWikiToProjects < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ def change
+ add_column :projects, :has_external_wiki, :boolean
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 8882377f9f4..ebf31ded369 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160716115710) do
+ActiveRecord::Schema.define(version: 20160718153603) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -842,6 +842,7 @@ ActiveRecord::Schema.define(version: 20160716115710) do
t.boolean "only_allow_merge_if_build_succeeds", default: false, null: false
t.boolean "has_external_issue_tracker"
t.string "repository_storage", default: "default", null: false
+ t.boolean "has_external_wiki"
end
add_index "projects", ["builds_enabled", "shared_runners_enabled"], name: "index_projects_on_builds_enabled_and_shared_runners_enabled", using: :btree