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-22 18:15:02 +00:00
|
|
|
deviceToken: String, // Device token
|
|
|
|
deviceType: String, // Device type, such as apns
|
2013-07-08 23:59:11 +00:00
|
|
|
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) {
|
2013-07-30 21:26:49 +00:00
|
|
|
dataSource = dataSource || new require('loopback-datasource-juggler').ModelBuilder();
|
2013-07-09 22:06:42 +00:00
|
|
|
var Installation = dataSource.define('Installation', InstallationSchema);
|
|
|
|
return Installation;
|
|
|
|
}
|