mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Migrations - Fix possible DB issue with migrator
This commit is contained in:
parent
2eeae54d58
commit
7251dcf226
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Artemis.Storage.Entities.Profile;
|
||||
using Artemis.Storage.Entities.Profile.Nodes;
|
||||
@ -63,13 +64,13 @@ public class M0021GradientNodes : IStorageMigration
|
||||
public void Apply(LiteRepository repository)
|
||||
{
|
||||
// Find all color gradient data bindings, there's no really good way to do this so infer it from the value
|
||||
ILiteCollection<ProfileEntity> collection = repository.Database.GetCollection<ProfileEntity>();
|
||||
foreach (ProfileEntity profileEntity in collection.FindAll())
|
||||
List<ProfileEntity> profiles = repository.Query<ProfileEntity>().ToList();
|
||||
foreach (ProfileEntity profileEntity in profiles)
|
||||
{
|
||||
foreach (LayerEntity layer in profileEntity.Layers)
|
||||
MigrateDataBinding(layer.LayerBrush.PropertyGroup);
|
||||
|
||||
collection.Update(profileEntity);
|
||||
repository.Update(profileEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user