2020-04-11 16:47:27 -04:00

19 lines
579 B
JavaScript

'use ';
const client = require('../utils/redis');
(async function(){
await client.RENAME('hosts', 'host');
let hosts = await client.SMEMBERS('host');
for(let host of hosts){
let user = await client.HGET('host_'+host, 'username');
await client.HSET('host_'+host, 'created_by', user);
let created_on = await client.HGET('host_'+host, 'updated');
await client.HSET('host_'+host, 'created_on', created_on);
await client.HSET('host_'+host, 'updated_on', created_on);
await client.HDEL('host_'+host, 'username');
await client.HDEL('host_'+host, 'updated');
}
})()