-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add migration of device model commands from st table to database #1209 #1210
Add migration of device model commands from st table to database #1209 #1210
Conversation
2048342
to
acf562f
Compare
Codecov ReportBase: 88.23% // Head: 88.16% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1210 +/- ##
==========================================
- Coverage 88.23% 88.16% -0.08%
==========================================
Files 210 211 +1
Lines 6921 6927 +6
==========================================
Hits 6107 6107
- Misses 814 820 +6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
foreach (var item in table.Query<TableEntity>().ToArray()) | ||
{ | ||
if (await set.AnyAsync(c => c.Id == item.RowKey)) | ||
continue; | ||
|
||
#pragma warning disable CS8629 // Nullable value type may be null. | ||
_ = await set.AddAsync(new DeviceModelCommand | ||
{ | ||
Id = item.RowKey, | ||
Frame = item[nameof(DeviceModelCommand.Frame)].ToString(), | ||
Port = int.Parse(item[nameof(DeviceModelCommand.Port)].ToString(), CultureInfo.InvariantCulture), | ||
IsBuiltin = bool.Parse(item[nameof(DeviceModelCommand.IsBuiltin)]?.ToString() ?? "false"), | ||
Confirmed = bool.Parse(item[nameof(DeviceModelCommand.Confirmed)]?.ToString() ?? "false"), | ||
DeviceModelId = item.PartitionKey | ||
}); | ||
#pragma warning restore CS8629 // Nullable value type may be null. | ||
|
||
if (config is ProductionConfigHandler) | ||
{ | ||
_ = await table.DeleteEntityAsync(item.PartitionKey, item.RowKey); | ||
} | ||
} |
Check notice
Code scanning / CodeQL
Missed opportunity to use Where
Description
What's new?
What kind of change does this PR introduce?