Added industries collection

This commit is contained in:
vjrj 2018-02-26 12:11:23 +01:00
parent 1ad6bf17cb
commit ccbfe642a8
19 changed files with 277 additions and 58 deletions

View file

@ -7,6 +7,8 @@ import UserSubsToFiresCollection from '/imports/api/Subscriptions/Subscriptions'
import FireAlertsCollection from '/imports/api/FireAlerts/FireAlerts';
import SiteSettings from '/imports/api/SiteSettings/SiteSettings';
import FalsePositives from '/imports/api/FalsePositives/FalsePositives';
import Industries from '/imports/api/Industries/Industries';
import IndustryRegistries from '/imports/api/Industries/IndustryRegistries';
Meteor.startup(() => {
// https://github.com/percolatestudio/meteor-migrations
@ -127,6 +129,22 @@ Meteor.startup(() => {
}
});
Migrations.add({
version: 9,
up: function siteSettingsAddIndex() {
Industries._ensureIndex({ registry: 1 });
Industries._ensureIndex({ geo: '2dsphere' });
// https://www.eea.europa.eu/data-and-maps/data/member-states-reporting-art-7-under-the-european-pollutant-release-and-transfer-register-e-prtr-regulation-16
IndustryRegistries.insert({
_id: '1', name: 'E-PRTR', agency: 'EEA', region: 'EU'
});
// https://www.epa.gov/enviro/epa-frs-facilities-state-single-file-csv-download
IndustryRegistries.insert({
_id: '2', name: 'FRS', agency: 'EPA', region: 'US'
});
}
});
// Set createdAt in users & subs
Migrations.migrateTo('latest');