diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2015-11-16 17:59:15 +0300 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2015-11-16 17:59:15 +0300 |
commit | 84c71e5d827f1a0b225b7f6e9eeabe00a9c3eadd (patch) | |
tree | bcd374d71f362a8281afc7e730c22b7dfbef126b | |
parent | f445d3d1f317d8addbe60cf31fa15ca592ba0d19 (diff) |
Add unique to oid index for lfs object.
-rw-r--r-- | db/migrate/20151116144118_add_unique_for_lfs_oid_index.rb | 7 | ||||
-rw-r--r-- | db/schema.rb | 5 |
2 files changed, 9 insertions, 3 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 4870fe3fc4c..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" @@ -430,8 +430,7 @@ ActiveRecord::Schema.define(version: 20151114113410) do 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 |