react-code-dataset / spectrum /api /migrations /20170616113103-compound-indexes-for-ordering.js
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
exports.up = function(r, conn) {
return Promise.all([
// messages#threadIdAndTimestamp
r
.table('messages')
.indexCreate('threadIdAndTimestamp', [
r.row('threadId'),
r.row('timestamp'),
])
.run(conn),
// threads#channelIdAndLastActive
r
.table('threads')
.indexCreate('channelIdAndLastActive', [
r.row('channelId'),
r.row('lastActive'),
])
.run(conn),
// threads#communityIdAndLastActive
r
.table('threads')
.indexCreate('communityIdAndLastActive', [
r.row('communityId'),
r.row('lastActive'),
])
.run(conn),
// community#createdAt
r
.table('communities')
.indexCreate('createdAt')
.run(conn),
]).catch(err => {
console.log(err);
throw err;
});
};
exports.down = function(r, conn) {
return Promise.resolve();
};