summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2017-12-22 20:07:49 +0100
committerMatija Čupić <matteeyah@gmail.com>2017-12-22 20:07:49 +0100
commit705022d11422e42f5ff2473bdc1c80ddd0be9529 (patch)
tree5cb3acdb9ccdd34740360e03f5bcb95042bc3232
parentb3f27aed775232200533a4df2a6e7cc70be13574 (diff)
downloadgitlab-ce-705022d11422e42f5ff2473bdc1c80ddd0be9529.tar.gz
Add cache_index migration
-rw-r--r--db/migrate/20171222183504_add_cache_index_to_project.rb19
-rw-r--r--db/schema.rb3
2 files changed, 21 insertions, 1 deletions
diff --git a/db/migrate/20171222183504_add_cache_index_to_project.rb b/db/migrate/20171222183504_add_cache_index_to_project.rb
new file mode 100644
index 00000000000..f43be14fb42
--- /dev/null
+++ b/db/migrate/20171222183504_add_cache_index_to_project.rb
@@ -0,0 +1,19 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddCacheIndexToProject < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_column_with_default(:projects, :cache_index, :integer, default: 0)
+ end
+
+ def down
+ remove_column(:projects, :cache_index)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index aa5db5da4f0..5ecfb0651c6 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: 20171220191323) do
+ActiveRecord::Schema.define(version: 20171222183504) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -1447,6 +1447,7 @@ ActiveRecord::Schema.define(version: 20171220191323) do
t.boolean "repository_read_only"
t.boolean "merge_requests_ff_only_enabled", default: false
t.boolean "merge_requests_rebase_enabled", default: false, null: false
+ t.integer "cache_index", default: 0, null: false
end
add_index "projects", ["ci_id"], name: "index_projects_on_ci_id", using: :btree