Move features extensions in their own new table

Description

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.

Zendesk Ticket IDs

None

Activity

Show:

Nabil Ben Youssef August 15, 2023 at 3:30 PM

be careful, there is a related task https://wazo-dev.atlassian.net/browse/NES-2163

Nabil Ben Youssef August 8, 2023 at 1:54 PM
Edited

confirmed: WDA / mobile app / Portal don’t use GET /extensions?is_feature=true neither GET /extensions?feature=unefeature

Nabil Ben Youssef August 7, 2023 at 8:53 PM

Portal : /extensions/features endpoint is used to interact with the features extensions

Nabil Ben Youssef August 3, 2023 at 8:24 PM

waiting feedback to see if GET /extensions?is_feature=true or GET /extensions?feature=unefeature are used by Portal/app….

Nabil Ben Youssef August 3, 2023 at 7:38 PM

updating confgend…

Done

Details

Priority

Assignee

Reporter

Approvers

Pascal Cadotte

Fix versions

Sprint

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