diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-06-12 20:19:00 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-06-26 18:49:30 +0300 |
commit | d6a0c288c89765fa8f0e96aedefc608dd7025491 (patch) | |
tree | 3509b6488eace44f18ed7cdf8242ffdd1a58de30 | |
parent | 229ac39a4c7f7cc4fa207ffa1c826e114df2906a (diff) |
Use the migration name as a key in redis
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb b/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb index 3bf549a56eb..ce82a57fe7e 100644 --- a/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb +++ b/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb @@ -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? diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb index f4e19f09419..2ce3fc0b497 100644 --- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb +++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb @@ -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') diff --git a/spec/support/fake_migration_classes.rb b/spec/support/fake_migration_classes.rb index 33cd1043132..b0fc8422857 100644 --- a/spec/support/fake_migration_classes.rb +++ b/spec/support/fake_migration_classes.rb @@ -4,4 +4,8 @@ class FakeRenameReservedPathMigrationV1 < ActiveRecord::Migration def version '20170316163845' end + + def name + "FakeRenameReservedPathMigrationV1" + end end |