Done
Details
Priority
MediumAssignee
Nabil Ben YoussefNabil Ben YoussefReporter
Nabil Ben YoussefNabil Ben YoussefApprovers
Pascal CadotteFix versions
Sprint
NoneLabels
Details
Details
Priority
Assignee
Nabil Ben Youssef
Nabil Ben YoussefReporter
Nabil Ben Youssef
Nabil Ben YoussefApprovers
Pascal Cadotte
Fix versions
Sprint
None
Labels
Zendesk Support
Zendesk Support
Zendesk Support
Created July 26, 2023 at 1:06 PM
Updated August 30, 2023 at 3:12 PM
Resolved August 16, 2023 at 5:21 PM
Fact: when a tenant is deleted, their contexts are deleted too.
But we may have an issue with the ‘extensions’ => the extensions resources are not properly removed when the tenant is deleted.
The table ‘extensions' contains a field
context
without a foreign key pointing to the table ‘context’.Setting up a foreign key here will allow the database to automatically delete the extensions when a context is deleted.
Now we cannot put in place a foreign key on the table ‘extensions’ for the field
context
.This table contains the extensions and the “features” extensions. These special extensions are shared with all the tenants and are used by the features like listening the voicemail, enabling/disabling the forwarding, … These extensions used a special context ‘xivo-features’ that is created later in the process of the stack creation. So putting a fk to a context that doesn't exist yet is not possible.
FYI: The features extensions are created here : https://github.com/wazo-platform/xivo-manage-db/blob/f8a5596434ce49f62ccf84fba92a6e2c0a55050e/populate/populate.sql
The features extensions should be in their own new table named feature_extension having the following fields:
uuid: UUID
enabled: boolean
exten: string
feature: string
context
field is not needed because these extensions are stack-wide.Once the features extensions are moved into their own table, we can put a foreign key on the table extensions for the field
context
.The extension deletion must be fixed, because we may have conflict if another tenant is trying to create a tenant with the same number+context name.