mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
40 lines
740 B
JavaScript
40 lines
740 B
JavaScript
var r = require('rethinkdb')
|
|
|
|
module.exports = {
|
|
users: {
|
|
primaryKey: 'email'
|
|
, indexes: {
|
|
adbKeys: {
|
|
indexFunction: function(user) {
|
|
return user('adbKeys')('fingerprint')
|
|
}
|
|
, options: {
|
|
multi: true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
, 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'
|
|
}
|
|
}
|