23 lines
702 B
C#
23 lines
702 B
C#
using DataModel.Database.Common;
|
|
|
|
namespace DataModel.MigrationScripts;
|
|
|
|
public static class Script202211AddUniqueIds
|
|
{
|
|
public static async Task PostMigrationAsync(DataContext db)
|
|
{
|
|
await foreach (var setting in db.Settings)
|
|
setting.UniqueId = Guid.NewGuid();
|
|
|
|
await foreach(var section in db.Sections)
|
|
section.UniqueId = Guid.NewGuid();
|
|
|
|
await foreach (var textElement in db.TextElements)
|
|
textElement.UniqueId = Guid.NewGuid();
|
|
|
|
await foreach (var translation in db.Translations)
|
|
translation.UniqueId = Guid.NewGuid();
|
|
|
|
await db.SaveChangesAsync();
|
|
}
|
|
} |