Commit d6a0c288 authored by Bob Van Landuyt's avatar Bob Van Landuyt Committed by Bob Van Landuyt

Use the migration name as a key in redis

parent 229ac39a
...@@ -144,7 +144,7 @@ module Gitlab ...@@ -144,7 +144,7 @@ module Gitlab
end end
def redis_key_for_type(type) def redis_key_for_type(type)
"rename:#{migration.version}:#{type}" "rename:#{migration.name}:#{type}"
end end
def file_storage? def file_storage?
......
...@@ -231,7 +231,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :trunca ...@@ -231,7 +231,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :trunca
describe '#track_rename', redis: true do describe '#track_rename', redis: true do
it 'tracks a rename in redis' do it 'tracks a rename in redis' do
key = 'rename:20170316163845:namespace' key = 'rename:FakeRenameReservedPathMigrationV1:namespace'
subject.track_rename('namespace', 'path/to/namespace', 'path/to/renamed') subject.track_rename('namespace', 'path/to/namespace', 'path/to/renamed')
......
...@@ -4,4 +4,8 @@ class FakeRenameReservedPathMigrationV1 < ActiveRecord::Migration ...@@ -4,4 +4,8 @@ class FakeRenameReservedPathMigrationV1 < ActiveRecord::Migration
def version def version
'20170316163845' '20170316163845'
end end
def name
"FakeRenameReservedPathMigrationV1"
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment