08a2ee521e7de5d6ced44526766571fec2c6641a
[motion-next.git] / server / migrations / 2.4.19.js
1 const a1002_0x2594=['indexName','STRING','ENUM','then','type','UPDATE\x20int_zoho_configurations\x20SET\x20moduleCreate\x20=\x20\x27contact\x27\x20WHERE\x20moduleCreate\x20=\x20\x27Contacts\x27','sequence','moduleSearch','UPDATE\x20int_zoho_configurations\x20SET\x20moduleCreate\x20=\x20\x27lead\x27\x20WHERE\x20moduleCreate\x20=\x20\x27Leads\x27','Added\x20column\x20%s\x20to\x20%s','Removed\x20column\x20%s\x20from\x20%s','join','migration','changeColumn','contact_lead','enqueue','dropTable','query','catch','lead','turn','removeColumn','info','sequelize','Leads','INSERT\x20INTO\x20network\x20(type,value,\x20createdAt,\x20updatedAt)\x20SELECT\x20\x27stun\x27,\x20stunaddr,\x20current_timestamp(),\x20current_timestamp()\x20from\x20settings\x20WHERE\x20stunaddr<>\x27\x27','int_zoho_configurations','username','tail','stringify','renameColumn','addIndex','final','Contacts','removeIndex','queryInterface','addIndex\x20%s\x20%s\x20%s\x20[%s]','exports','nothing','network','indicesType','prototype','moduleCreate','contact','password','stun','addColumn','inspect','../config/logger'];(function(_0x3def7a,_0x2594b5){const _0x29f07b=function(_0x53c210){while(--_0x53c210){_0x3def7a['push'](_0x3def7a['shift']());}};_0x29f07b(++_0x2594b5);}(a1002_0x2594,0x141));const a1002_0x29f0=function(_0x3def7a,_0x2594b5){_0x3def7a=_0x3def7a-0x0;let _0x29f07b=a1002_0x2594[_0x3def7a];return _0x29f07b;};const _0x3300aa=a1002_0x29f0;'use strict';const util=require('util'),logger=require(_0x3300aa('0x15'))(_0x3300aa('0x22')),Sequence=function(){};Sequence[_0x3300aa('0xe')][_0x3300aa('0x25')]=function(_0x53c210){const _0x131fef=_0x3300aa;this['tail']=this[_0x131fef('0x1')]?this['tail']['finally'](_0x53c210):_0x53c210();};const Migration=function(_0x5d4354){const _0x38c8a9=_0x3300aa;this[_0x38c8a9('0x8')]=_0x5d4354,this[_0x38c8a9('0x1c')]=new Sequence();};Migration[_0x3300aa('0xe')]['changeColumn']=function(_0x16c5ce,_0x4a5c12,_0x123200){const _0x398b57=_0x3300aa,_0x241c4a=this;this['sequence'][_0x398b57('0x25')](function(){const _0x568303=_0x398b57;return _0x241c4a[_0x568303('0x8')][_0x568303('0x23')](_0x16c5ce,_0x4a5c12,_0x123200)['then'](function(){const _0xc45a8b=_0x568303;logger[_0xc45a8b('0x2c')]('Changed\x20column\x20%s\x20in\x20table\x20%s',_0x4a5c12,_0x16c5ce);})['catch'](function(_0x578bb1){const _0x1690ea=_0x568303;logger[_0x1690ea('0x2c')](JSON[_0x1690ea('0x2')](_0x578bb1));});});},Migration[_0x3300aa('0xe')]['addColumn']=function(_0x316636,_0x53ece3,_0x14f587){const _0x458625=_0x3300aa,_0x472907=this;this[_0x458625('0x1c')][_0x458625('0x25')](function(){const _0x259f5a=_0x458625;return _0x472907['queryInterface'][_0x259f5a('0x13')](_0x316636,_0x53ece3,_0x14f587)[_0x259f5a('0x19')](function(){const _0x1ec9e4=_0x259f5a;logger[_0x1ec9e4('0x2c')](_0x1ec9e4('0x1f'),_0x53ece3,_0x316636);})[_0x259f5a('0x28')](function(_0x52a443){const _0x1b897d=_0x259f5a;logger[_0x1b897d('0x2c')](JSON['stringify'](_0x52a443));});});},Migration['prototype'][_0x3300aa('0x26')]=function(_0x2003ab){const _0x23b72d=_0x3300aa,_0x4e08f3=this;this[_0x23b72d('0x1c')][_0x23b72d('0x25')](function(){const _0x11ed76=_0x23b72d;return _0x4e08f3[_0x11ed76('0x8')][_0x11ed76('0x26')](_0x2003ab,{'force':!![]})['then'](function(){logger['info']('table\x20dropped\x20%s',_0x2003ab);})[_0x11ed76('0x28')](function(_0x6f3b0f){const _0x42dd44=_0x11ed76;logger['info'](JSON[_0x42dd44('0x2')](_0x6f3b0f));});});},Migration[_0x3300aa('0xe')]['addIndex']=function(_0x40fe9e,_0x4bbc5b,_0x5f80ad){const _0x2acde0=_0x3300aa,_0x52fd0e=this;this[_0x2acde0('0x1c')][_0x2acde0('0x25')](function(){const _0xbd0655=_0x2acde0;return _0x52fd0e[_0xbd0655('0x8')][_0xbd0655('0x4')](_0x40fe9e,_0x4bbc5b,{'indexName':_0x5f80ad[_0xbd0655('0x16')],'indicesType':_0x5f80ad[_0xbd0655('0xd')]})['then'](function(){const _0xcbe384=_0xbd0655;logger[_0xcbe384('0x2c')](_0xcbe384('0x9'),_0x40fe9e,_0x4bbc5b[_0xcbe384('0x21')](','),_0x5f80ad[_0xcbe384('0x16')],_0x5f80ad[_0xcbe384('0xd')]);})['catch'](function(_0x4002da){const _0x118c59=_0xbd0655;logger[_0x118c59('0x2c')](JSON[_0x118c59('0x2')](_0x4002da));});});},Migration[_0x3300aa('0xe')][_0x3300aa('0x7')]=function(_0x2250a7,_0x264658){const _0x8e4674=_0x3300aa,_0x1ce5e0=this;this[_0x8e4674('0x1c')]['enqueue'](function(){const _0x85d502=_0x8e4674;return _0x1ce5e0['queryInterface']['removeIndex'](_0x2250a7,_0x264658)[_0x85d502('0x19')](function(){const _0x15c285=_0x85d502;logger[_0x15c285('0x2c')]('removeIndex\x20%s\x20%s',_0x2250a7,_0x264658);})[_0x85d502('0x28')](function(_0x3d6db8){const _0x3c4681=_0x85d502;logger[_0x3c4681('0x2c')](JSON['stringify'](_0x3d6db8));});});},Migration['prototype'][_0x3300aa('0x27')]=function(_0x512554){const _0x39ad50=_0x3300aa,_0xad7d17=this;this[_0x39ad50('0x1c')]['enqueue'](function(){const _0x245524=_0x39ad50;return _0xad7d17[_0x245524('0x8')][_0x245524('0x2d')][_0x245524('0x27')](_0x512554)[_0x245524('0x19')](function(){logger['info']('query\x20%s',_0x512554);})['catch'](function(_0x58c135){const _0x589921=_0x245524;logger[_0x589921('0x2c')](JSON['stringify'](_0x58c135));});});},Migration[_0x3300aa('0xe')]['removeColumn']=function(_0x4d1944,_0x2e89d2){const _0x4b16de=_0x3300aa,_0x38b6fe=this;this[_0x4b16de('0x1c')][_0x4b16de('0x25')](function(){const _0x52816d=_0x4b16de;return _0x38b6fe[_0x52816d('0x8')][_0x52816d('0x2b')](_0x4d1944,_0x2e89d2)[_0x52816d('0x19')](function(){const _0x1e0fc8=_0x52816d;logger['info'](_0x1e0fc8('0x20'),_0x2e89d2,_0x4d1944);})[_0x52816d('0x28')](function(_0x43d997){const _0x4fd155=_0x52816d;logger[_0x4fd155('0x2c')](util['inspect'](_0x43d997,{'showHidden':![],'depth':null}));});});},Migration['prototype'][_0x3300aa('0x3')]=function(_0x1bbc59,_0x154c92,_0x4ad3bf){const _0xbae16e=_0x3300aa,_0x17ba52=this;this['sequence'][_0xbae16e('0x25')](function(){const _0x2df8e6=_0xbae16e;return _0x17ba52['queryInterface'][_0x2df8e6('0x3')](_0x1bbc59,_0x154c92,_0x4ad3bf)[_0x2df8e6('0x19')](function(){const _0x21fc50=_0x2df8e6;logger[_0x21fc50('0x2c')]('Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s',_0x154c92,_0x4ad3bf,_0x1bbc59);})[_0x2df8e6('0x28')](function(_0x1b43e9){const _0x2a4609=_0x2df8e6;logger['info'](util[_0x2a4609('0x14')](_0x1b43e9,{'showHidden':![],'depth':null}));});});},Migration['prototype'][_0x3300aa('0x5')]=function(_0x5082a1){const _0x1a3529=_0x3300aa;this[_0x1a3529('0x1c')][_0x1a3529('0x25')](function(){return _0x5082a1();});},module[_0x3300aa('0xa')]={'up':function(_0x48346e,_0x12bbb7){return new Promise(function(_0x13a3ce){const _0xa7469e=a1002_0x29f0,_0x203d74=new Migration(_0x48346e);_0x203d74[_0xa7469e('0x13')](_0xa7469e('0x30'),_0xa7469e('0x1d'),{'type':_0x12bbb7[_0xa7469e('0x18')](_0xa7469e('0x24'),_0xa7469e('0x10'),_0xa7469e('0x29')),'defaultValue':_0xa7469e('0x24')}),_0x203d74['changeColumn'](_0xa7469e('0x30'),_0xa7469e('0xf'),{'type':_0x12bbb7[_0xa7469e('0x18')](_0xa7469e('0x2e'),_0xa7469e('0x6'),_0xa7469e('0xb'),_0xa7469e('0x10'),_0xa7469e('0x29'))}),_0x203d74[_0xa7469e('0x27')](_0xa7469e('0x1b')),_0x203d74[_0xa7469e('0x27')](_0xa7469e('0x1e')),_0x203d74['changeColumn'](_0xa7469e('0x30'),_0xa7469e('0xf'),{'type':_0x12bbb7[_0xa7469e('0x18')](_0xa7469e('0xb'),_0xa7469e('0x10'),_0xa7469e('0x29')),'defaultValue':_0xa7469e('0x29')}),_0x203d74[_0xa7469e('0x13')](_0xa7469e('0xc'),_0xa7469e('0x0'),{'type':_0x12bbb7[_0xa7469e('0x17')]}),_0x203d74[_0xa7469e('0x13')](_0xa7469e('0xc'),_0xa7469e('0x11'),{'type':_0x12bbb7['STRING']}),_0x203d74[_0xa7469e('0x23')](_0xa7469e('0xc'),_0xa7469e('0x1a'),{'type':_0x12bbb7['ENUM']('localnet','externip',_0xa7469e('0x12'),_0xa7469e('0x2a'))}),_0x203d74['query'](_0xa7469e('0x2f')),_0x203d74[_0xa7469e('0x27')]('INSERT\x20INTO\x20network\x20(type,value,username,password,\x20createdAt,\x20updatedAt)\x20SELECT\x20\x27turn\x27,\x20turnaddr,\x20turnusername,\x20turnpassword,\x20current_timestamp(),\x20current_timestamp()\x20from\x20settings\x20WHERE\x20turnaddr<>\x27\x27'),_0x203d74[_0xa7469e('0x5')](_0x13a3ce);});},'down':function(){}};