summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2017-08-04 07:30:42 +0200
committerGabriel Mazetto <brodock@gmail.com>2017-08-22 06:33:20 +0200
commit9e6fa996eab978506af1084b79a9c3f91f6d575b (patch)
tree39cdc0aafa13c16551f4f7f244a19e94d6b8582f /db
parent53403399577bdca0e8f0886fa62ce0e75c14a8e0 (diff)
downloadgitlab-ce-9e6fa996eab978506af1084b79a9c3f91f6d575b.tar.gz
New storage is now "Hashed" instead of "UUID"
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170802013652_add_storage_fields_to_project.rb24
-rw-r--r--db/schema.rb5
2 files changed, 4 insertions, 25 deletions
diff --git a/db/migrate/20170802013652_add_storage_fields_to_project.rb b/db/migrate/20170802013652_add_storage_fields_to_project.rb
index 269103cd472..a0815da0fcd 100644
--- a/db/migrate/20170802013652_add_storage_fields_to_project.rb
+++ b/db/migrate/20170802013652_add_storage_fields_to_project.rb
@@ -4,36 +4,16 @@
class AddStorageFieldsToProject < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
- # Set this constant to true if this migration requires downtime.
DOWNTIME = false
-
- # When a migration requires downtime you **must** uncomment the following
- # constant and define a short and easy to understand explanation as to why the
- # migration requires downtime.
- # DOWNTIME_REASON = ''
-
- # When using the methods "add_concurrent_index", "remove_concurrent_index" or
- # "add_column_with_default" you must disable the use of transactions
- # as these methods can not run in an existing transaction.
- # When using "add_concurrent_index" or "remove_concurrent_index" methods make sure
- # that either of them is the _only_ method called in the migration,
- # any other changes should go in a separate migration.
- # This ensures that upon failure _only_ the index creation or removing fails
- # and can be retried or reverted easily.
- #
- # To disable transactions uncomment the following line and remove these
- # comments:
disable_ddl_transaction!
def up
# rubocop:disable Migration/AddColumnWithDefaultToLargeTable
- add_column :projects, :uuid, :uuid
- add_column_with_default :projects, :storage_version, :integer, default: 0, limit: 1
- add_concurrent_index :projects, :uuid
+ add_column :projects, :storage_version, :integer, limit: 2
+ add_concurrent_index :projects, :storage_version
end
def down
- remove_column :projects, :uuid
remove_column :projects, :storage_version
end
end
diff --git a/db/schema.rb b/db/schema.rb
index dcd9532e4be..5a85a00bb12 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1208,8 +1208,7 @@ ActiveRecord::Schema.define(version: 20170820100558) do
t.datetime "last_repository_updated_at"
t.string "ci_config_path"
t.text "delete_error"
- t.uuid "uuid"
- t.integer "storage_version", limit: 2, default: 0, null: false
+ t.integer "storage_version", limit: 2
end
add_index "projects", ["ci_id"], name: "index_projects_on_ci_id", using: :btree
@@ -1226,7 +1225,7 @@ ActiveRecord::Schema.define(version: 20170820100558) do
add_index "projects", ["pending_delete"], name: "index_projects_on_pending_delete", using: :btree
add_index "projects", ["runners_token"], name: "index_projects_on_runners_token", using: :btree
add_index "projects", ["star_count"], name: "index_projects_on_star_count", using: :btree
- add_index "projects", ["uuid"], name: "index_projects_on_uuid", using: :btree
+ add_index "projects", ["storage_version"], name: "index_projects_on_storage_version", using: :btree
add_index "projects", ["visibility_level"], name: "index_projects_on_visibility_level", using: :btree
create_table "protected_branch_merge_access_levels", force: :cascade do |t|