mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
Feature repository specific data migration (#1526)
This adds a new migration mechanism for repository data. Instead of using UpdateSteps for all data migrations, repository data shall from now on be implemented with RepositoryUpdateSteps. The general logic stays the same. Executed updates are stored with the repository. Doing this, we can now execute updates on imported repositories without touching other data. This way we can import repositories even though they were exported with older versions of SCM-Manager or a plugin.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.store;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -38,10 +38,13 @@ public class InMemoryConfigurationEntryStoreFactory implements ConfigurationEntr
|
||||
@Override
|
||||
public <T> ConfigurationEntryStore<T> getStore(TypedStoreParameters<T> storeParameters) {
|
||||
String name = storeParameters.getName();
|
||||
if (storeParameters.getRepositoryId() != null) {
|
||||
name = name + "-" + storeParameters.getRepositoryId();
|
||||
}
|
||||
return get(name);
|
||||
}
|
||||
|
||||
public <T> InMemoryConfigurationEntryStore<T> get(String name) {
|
||||
return stores.computeIfAbsent(name, x -> new InMemoryConfigurationEntryStore());
|
||||
return stores.computeIfAbsent(name, x -> new InMemoryConfigurationEntryStore<T>());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user