Skip to content
Snippets Groups Projects
Commit 24cabcf3 authored by Alex Brazier's avatar Alex Brazier
Browse files

Add migration for analytics

parent 946ec4e2
No related branches found
No related tags found
No related merge requests found
RocketChat.Migrations.add({
version: 90,
up() {
RocketChat.models.Settings.remove({ _id: 'Piwik', type: 'group' });
const settings = RocketChat.models.Settings.find({$or: [{_id: 'PiwikAnalytics_url', value: {$ne: null}}, {_id: 'PiwikAnalytics_siteId', value: {$ne: null}}]}).fetch();
if (settings && settings.length === 2) {
RocketChat.models.Settings.upsert({_id: 'PiwikAnalytics_enabled'}, {$set: {value: true}});
}
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment