blob: 82952bb8cc9375861c3315e1e62d1f8349e36a6f [file] [log] [blame]
var r = require('rethinkdb')
module.exports = {
users: {
primaryKey: 'email'
, indexes: {
adbKeys: {
indexFunction: function(user) {
return user('adbKeys')('fingerprint')
}
, options: {
multi: true
}
}
}
}
, accessTokens: {
primaryKey: 'id'
, indexes: {
email: null
}
}
, vncauth: {
primaryKey: 'password'
, indexes: {
response: null
, responsePerDevice: {
indexFunction: function(row) {
return [row('response'), row('deviceId')]
}
}
}
}
, devices: {
primaryKey: 'serial'
, indexes: {
owner: {
indexFunction: function(device) {
return r.branch(
device('present')
, device('owner')('email')
, r.literal()
)
}
}
, present: null
, providerChannel: {
indexFunction: function(device) {
return device('provider')('channel')
}
}
}
}
, logs: {
primaryKey: 'id'
}
, deviceEvents: {
primaryKey: 'id'
}
, tokens: {
primaryKey: 'token'
}
, kicks: {
primaryKey: 'id'
}
, tokenLogcats: {
primaryKey: 'id'
}
, deviceApps: {
primaryKey: 'appId'
}
}