patrickomni / omnimobileserver

Stubbed repository; using issues lists
0 stars 0 forks source link

Orphan devices cannot be re-saved to a new account #332

Closed peters95 closed 8 years ago

peters95 commented 8 years ago

When a device is orphaned for example:

SELECT * FROM [dbo].[DeviceInventory] di LEFT JOIN [dbo].[Account] a on di.AccountId = a.Id WHERE a.Id is NULL

150 1195 NULL 5 89 47.606778,-122.201132 NULL 4 Mini Mart #5 FRZ55 NULL 198 1249 5 139 47.688163,-122.07628 UNITTEST 4 Fridge 1 FRIDGE1 wewe 199 1249 5 0 47.688163,-122.07628 UNITTEST 4 Fridge 2 FRIDGE2 sdf 228 1249 NULL 10 139 47.0,-122 NULL 4 Nimble 1 355826019401636 NULL 229 1249 NULL 10 139 47.0,-122 NULL 4 Nimble 2 (Omni) A100003E4851A0 NULL 215 1249 NULL 4 149 48.842977,-122.302318 UNITTEST 16 Truck 2 TRUCK2 NULL

And you try to fix the device by adding it to a new account it fails due to its previously being on a past account.

The intended goal would be for business user to be able to re-save and device will be changed to new account and now appear in this list w/ updated values based upon DeviceId match which is unique index in DB schema already.