Conversation
|
To be discussed: Can sensors be orphans? I.e. when we delete a GenericAsset, should assorted sensors be deleted automatically? For now, I found code that suggests so and followed through. |
Flix6x
left a comment
There was a problem hiding this comment.
Mostly I just request some documentation, and a short Marshmallow validator for account_id. I also found one or two potential small issues.
Concerning the cascading deletion of sensors and their data, rather than keeping around orphaned data, the way you implemented it here is in line with my preference. That said, I'd recommend being more explicit about the effects of deleting an account.
… & downgrading the database migration
…ke sure all test users have an account
…erived from asset.owner_id)
…he add user command. Make sure deleting GenericAssets actually csscades to deleting the connected sensors.
…account_id to /user docs
… used to delete an account
c1ef6ea to
b95811f
Compare
|
I re-based this PR on main (should make it easier to view changes) and fixed a few small things. |
Flix6x
left a comment
There was a problem hiding this comment.
Congratulations on this milestone achievement!
closes #158
Upgrading the database
Verify that the current revision is
b6d49ed7ccebor higher before checking out this branch.The upgrade should be straightforward:
This will:
generic_asset.owner_idassociations (and move them togeneric_asset.account_id, using the accounts from step 1). This will be backed up locally, should you want todb downgradelater.Note:
You can add custom user-account relationships, e.g.:
This would associate users 1, 3 and 30 to accounts with the names "Seita", "CustomerA" and "CustomerB", respectively, creating these accounts on the go.