diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-11-16 16:16:36 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-11-16 16:16:36 +0000 |
commit | 43d5eca084112dc29df5ca1a521f95acaf3c9ccb (patch) | |
tree | d0f7843c967cce588a48ebd7f32be7163ecee14f | |
parent | 9a3df9d5d015db292f9f50770158fdc3fdc4a6ca (diff) | |
parent | 84c71e5d827f1a0b225b7f6e9eeabe00a9c3eadd (diff) | |
download | gitlab-ce-43d5eca084112dc29df5ca1a521f95acaf3c9ccb.tar.gz |
Merge branch 'add_index_uniq' into 'master'
Add index uniq
Added unique on oid index. Removed the second index since it is unnecessary.
See merge request !1810
-rw-r--r-- | db/migrate/20151116144118_add_unique_for_lfs_oid_index.rb | 7 | ||||
-rw-r--r-- | db/schema.rb | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/db/migrate/20151116144118_add_unique_for_lfs_oid_index.rb b/db/migrate/20151116144118_add_unique_for_lfs_oid_index.rb new file mode 100644 index 00000000000..41b93da0a86 --- /dev/null +++ b/db/migrate/20151116144118_add_unique_for_lfs_oid_index.rb @@ -0,0 +1,7 @@ +class AddUniqueForLfsOidIndex < ActiveRecord::Migration + def change + remove_index :lfs_objects, :oid + remove_index :lfs_objects, [:oid, :size] + add_index :lfs_objects, :oid, unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index a8e8dfe6bbf..aa76cef9fe4 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: 20151114113410) do +ActiveRecord::Schema.define(version: 20151116144118) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -423,15 +423,14 @@ ActiveRecord::Schema.define(version: 20151114113410) do add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree create_table "lfs_objects", force: true do |t| - t.string "oid", null: false, unique: true + t.string "oid", null: false t.integer "size", null: false t.datetime "created_at" t.datetime "updated_at" t.string "file" end - add_index "lfs_objects", ["oid", "size"], name: "index_lfs_objects_on_oid_and_size", using: :btree - add_index "lfs_objects", ["oid"], name: "index_lfs_objects_on_oid", using: :btree + add_index "lfs_objects", ["oid"], name: "index_lfs_objects_on_oid", unique: true, using: :btree create_table "lfs_objects_projects", force: true do |t| t.integer "lfs_object_id", null: false |