Skip to content
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

Handle tenant-refresh flow on the users table #686

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

lindgrenj6
Copy link
Contributor

Problem: when tenant-refresh occurs in stage we have to go through and manually update the database for all users that had their org_ids changed.

Solution: we just tack on an on conflict update on the create statement which updates the tenant_id to the new one. We'll probably end up with some orphan tenants this way but that is kind of expected since the refresh = everyone got a new identity anyway. As a followup we could probably now look for tenants that don't have users associated with them anymore and clean those records up.

@lpichler lpichler merged commit 3bac714 into main Mar 6, 2024
8 of 9 checks passed
@lpichler lpichler deleted the handle_tenant_refresh branch March 6, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants