BaseDataWindow: Fix WineAttr/WineCult Id updates in payment variant data
All checks were successful
Test / Run tests (push) Successful in 2m10s
All checks were successful
Test / Run tests (push) Successful in 2m10s
This commit is contained in:
@ -58,6 +58,8 @@ namespace Elwig.Windows {
|
||||
|
||||
foreach (var (old, attrid) in _attrs.Where(a => a.Value != null)) {
|
||||
await ctx.Database.ExecuteSqlAsync($"UPDATE wine_attribute SET attrid = {attrid} WHERE attrid = {old}");
|
||||
await ctx.Database.ExecuteSqlAsync($"UPDATE area_commitment_type SET vtrgid = (sortid || COALESCE(attrid, '') || COALESCE(disc, '')) WHERE attrid = {attrid}");
|
||||
await ctx.Database.ExecuteSqlRawAsync($"UPDATE payment_variant SET data = REPLACE(REPLACE(data, '/{old}\"', '/{attrid}\"'), '/{old}-', '/{attrid}-')");
|
||||
}
|
||||
await ctx.SaveChangesAsync();
|
||||
|
||||
|
@ -58,6 +58,7 @@ namespace Elwig.Windows {
|
||||
|
||||
foreach (var (old, cultid) in _cults.Where(c => c.Value != null)) {
|
||||
await ctx.Database.ExecuteSqlAsync($"UPDATE wine_cultivation SET cultid = {cultid} WHERE cultid = {old}");
|
||||
await ctx.Database.ExecuteSqlRawAsync($"UPDATE payment_variant SET data = REPLACE(data, '-{old}\"', '-{cultid}\"')");
|
||||
}
|
||||
await ctx.SaveChangesAsync();
|
||||
|
||||
|
Reference in New Issue
Block a user