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
Multi-tenancy #159
Multi-tenancy #159
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congratulations on this milestone achievement!
closes #158
Upgrading the database
Verify that the current revision is
b6d49ed7cceb
or higher before checking out this branch.The upgrade should be straightforward:
This will:
generic_asset.owner_id
associations (and move them togeneric_asset.account_id
, using the accounts from step 1). This will be backed up locally, should you want todb downgrade
later.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.