fixed migrations

This commit is contained in:
William Mantly 2020-04-11 16:30:25 -04:00
parent 1bf358565a
commit df69e4535a
2 changed files with 17 additions and 17 deletions

View File

@ -1,17 +0,0 @@
'use ';
const client = require('../utils/redis');
(async function(){
await client.rename('proxy_hosts', 'proxy_host');
let hosts = await client.SMEMBERS('proxy_host');
for(let host of hosts){
let user = await client.HGET('proxy_host_'+host, 'username');
await client.HSET('proxy_host_'+host, 'created_by', user);
let created_on = client.HGET('proxy_host_'+host, 'updated');
await client.HSET('proxy_host_'+host, 'created_on', created_on);
await client.HDEL('proxy_host_'+host, 'username');
await client.HDEL('proxy_host_'+host, 'updated')
}
})()

View File

@ -0,0 +1,17 @@
'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.HDEL('host_'+host, 'username');
await client.HDEL('host_'+host, 'updated');
}
})()