mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Remove rutil in favor of the updated rethinkdb driver.
This commit is contained in:
parent
9604f2dde2
commit
4234bb9e34
3 changed files with 8 additions and 34 deletions
|
@ -2,7 +2,6 @@ var r = require('rethinkdb')
|
|||
var Promise = require('bluebird')
|
||||
|
||||
var logger = require('../util/logger')
|
||||
var rutil = require('../util/rutil')
|
||||
var tables = require('./tables')
|
||||
|
||||
module.exports = function(conn) {
|
||||
|
@ -17,7 +16,7 @@ module.exports = function(conn) {
|
|||
}
|
||||
|
||||
function createDatabase() {
|
||||
return rutil.run(conn, r.dbCreate(conn.db))
|
||||
return r.dbCreate(conn.db).run(conn)
|
||||
.then(function() {
|
||||
log.info('Database "%s" created', conn.db)
|
||||
})
|
||||
|
@ -31,7 +30,7 @@ module.exports = function(conn) {
|
|||
var tableOptions = {
|
||||
primaryKey: options.primaryKey
|
||||
}
|
||||
return rutil.run(conn, r.tableCreate(table, tableOptions))
|
||||
return r.tableCreate(table, tableOptions).run(conn)
|
||||
.then(function() {
|
||||
log.info('Table "%s" created', table)
|
||||
})
|
||||
|
@ -54,7 +53,7 @@ module.exports = function(conn) {
|
|||
}
|
||||
|
||||
function createIndex(table, index, fn) {
|
||||
return rutil.run(conn, r.table(table).indexCreate(index, fn))
|
||||
return r.table(table).indexCreate(index, fn).run(conn)
|
||||
.then(function() {
|
||||
log.info('Index "%s"."%s" created', table, index)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue