fixed migrations
This commit is contained in:
parent
1bf358565a
commit
df69e4535a
@ -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')
|
|
||||||
}
|
|
||||||
})()
|
|
17
nodejs/migrations/host_1.js
Normal file
17
nodejs/migrations/host_1.js
Normal 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');
|
||||||
|
}
|
||||||
|
})()
|
Loading…
x
Reference in New Issue
Block a user