Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyyan317 committed Dec 12, 2024
1 parent eb4402b commit 60fed58
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/migration/cassandra/CassandraMigrationManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
#pragma once

#include "migration/cassandra/CassandraMigrationBackend.hpp"
#include "migration/cassandra/TestMigrator.hpp"
#include "migration/impl/MigrationManagerBase.hpp"
#include "migration/impl/MigratorsRegister.hpp"

namespace migration::cassandra {

// Register migrators here
// MigratorsRegister<CassandraMigrationBackend, ExampleMigrator>
using CassandraSupportedMigrators =
migration::impl::MigratorsRegister<CassandraMigrationBackend, SimpleTestMigrator3, SimpleTestMigrator4>;
using CassandraSupportedMigrators = migration::impl::MigratorsRegister<CassandraMigrationBackend>;

/// The Cassandra migration manager
using CassandraMigrationManager = migration::impl::MigrationManagerBase<CassandraSupportedMigrators>;
Expand Down
16 changes: 10 additions & 6 deletions src/migration/impl/MigratorsRegister.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,16 @@ class MigratorsRegister {
std::string
getMigratorDescription(std::string const& name) const

Check warning on line 159 in src/migration/impl/MigratorsRegister.hpp

View check run for this annotation

Codecov / codecov/patch

src/migration/impl/MigratorsRegister.hpp#L159

Added line #L159 was not covered by tests
{
// Fold expression to search through all types
std::string result = ([](std::string const& name) {
return std::string(getDescriptionIfMatch<MigratorType>(name));
}(name) + ...);

return result.empty() ? "No Description" : result;
if constexpr (sizeof...(MigratorType) == 0) {
return "No Description";
} else {
// Fold expression to search through all types
std::string result = ([](std::string const& name) {
return std::string(getDescriptionIfMatch<MigratorType>(name));
}(name) + ...);

return result.empty() ? "No Description" : result;
}

Check warning on line 170 in src/migration/impl/MigratorsRegister.hpp

View check run for this annotation

Codecov / codecov/patch

src/migration/impl/MigratorsRegister.hpp#L170

Added line #L170 was not covered by tests
}
};

Expand Down

0 comments on commit 60fed58

Please sign in to comment.