Add cache_index migration

This commit is contained in:
Matija Čupić 2017-12-22 20:07:49 +01:00
parent b3f27aed77
commit 705022d114
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
2 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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