Use the migration name as a key in redis

This commit is contained in:
Bob Van Landuyt 2017-06-12 19:19:00 +02:00 committed by Bob Van Landuyt
parent 229ac39a4c
commit d6a0c288c8
3 changed files with 6 additions and 2 deletions

View file

@ -144,7 +144,7 @@ module Gitlab
end
def redis_key_for_type(type)
"rename:#{migration.version}:#{type}"
"rename:#{migration.name}:#{type}"
end
def file_storage?

View file

@ -231,7 +231,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :trunca
describe '#track_rename', redis: true 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')

View file

@ -4,4 +4,8 @@ class FakeRenameReservedPathMigrationV1 < ActiveRecord::Migration
def version
'20170316163845'
end
def name
"FakeRenameReservedPathMigrationV1"
end
end