1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00
OpenSTF/lib/db/tables.js
2015-10-13 15:31:26 +09:00

51 lines
962 B
JavaScript

var r = require('rethinkdb')
module.exports = {
users: {
primaryKey: 'email'
, indexes: {
adbKeys: {
indexFunction: function(user) {
return user('adbKeys')('fingerprint')
}
, options: {
multi: true
}
}
}
}
, 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'
}
}