2013-07-01 22:53:10 +00:00
|
|
|
// See Device registration
|
2013-06-26 23:25:51 +00:00
|
|
|
var InstallationSchema = {
|
2013-07-08 23:59:11 +00:00
|
|
|
id: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
id: 1
|
|
|
|
},
|
2013-07-09 22:06:42 +00:00
|
|
|
appId: String, // Application id
|
|
|
|
appVersion: String, // Application version
|
|
|
|
userId: String, // User id
|
2013-07-08 23:59:11 +00:00
|
|
|
deviceToken: String,
|
|
|
|
deviceType: String,
|
|
|
|
subscriptions: [String],
|
2013-07-09 22:06:42 +00:00
|
|
|
|
|
|
|
status: {type: String, default: 'active'}, // Status of the application, production/sandbox/disabled
|
|
|
|
|
|
|
|
// Timestamps
|
|
|
|
created: {type: Date, default: Date},
|
|
|
|
modified: {type: Date, default: Date}
|
2013-06-26 23:25:51 +00:00
|
|
|
};
|
2013-07-09 22:06:42 +00:00
|
|
|
|
|
|
|
module.exports = function(dataSource) {
|
|
|
|
dataSource = dataSource || new require('jugglingdb').ModelBuilder();
|
|
|
|
var Installation = dataSource.define('Installation', InstallationSchema);
|
|
|
|
return Installation;
|
|
|
|
}
|