Hi everyone,
I opened few months ago a brainstorming for changing the DB schema of NotificationFilterPreferences, I’m coming back on the subject to vote for performing the following changes on the DB schema:
-
The columns
user
,pageOnly
,page
andwiki
are removed and replaced by 2 columns:scope
andentity
.entity
is a serialization of a reference so it’s typed asstring
in the schema.scope
is strongly typed thanks to a given java Enum and its values can be: USER, PAGE, SPACE or WIKI. -
The columns
emailEnabled
andalertEnabled
have been removed in favor in the schema of a set ofNotificationFormats
which is a java enum defining the available formats (Alert or Email for now): it means that a new tablenotification_filter_prefs_formats
is used containing only the format and using the ID of the filter as index. -
The column
allEventTypes
which was of type text in the schema has been removed in favor of a set ofString
: it means that a new tablenotification_filter_prefs_eventTypes
is used containing only one event type per row, and using the filter as index. Note that this solution allows to fix Loading... without needing a specific schema for Oracle. -
The column
active
has been removed without providing any replacement as the data is now useless and the related API are deprecated (see also: Loading...)
Note that you can already see the modifed schema in my draft PR: WIP: Migrate notification filter preferences to use another DB schema by surli · Pull Request #3154 · xwiki/xwiki-platform · GitHub
The goal of those changes is to allow better maintainability of the filters on the long run by allowing to create new formats / new scopes without needing a migration, and to keep as much as possible typing: for event types it’s not possible to have stronger type than String since that’s the only info we have (it’s the hint of the components).
This vote is only about changing the DB schema: it implies that we will have a migration to keep all data working with the new schema, except for the active
data information which will be lost (but it’s a useless data). Those changes are targeting 16.6.0RC1 only.
I’m opening this vote for 1 week, so until friday 14th.
Here’s my +1.