417277df0553e46c824616b0e307d41763c7be39
[motion-next.git] / server / migrations / 2.0.42.js
1 const a921_0x4e0c=['getCustomFields','users','../config/logger','table\x20dropped\x20%s','enqueue','api/cmCustomField/cmCustomField.model','#0091EA','sequence','openchannel_messages','query','Removed\x20column\x20%s\x20from\x20%s','sequelize','BOOLEAN','color','findAll','STRING','finally','tools_tags','migration','final','secret','switch','cm_contacts','notIn','changeColumn','then','number','util','info','Changed\x20column\x20%s\x20in\x20table\x20%s','tail','inspect','addColumn','dropTable','fax_messages','removeColumn','queryInterface','length','join','stringify','../config/environment','Added\x20column\x20%s\x20to\x20%s','query\x20%s','catch','prototype','TEXT','cf_'];(function(_0x1de914,_0x4e0cef){const _0x3647e8=function(_0x53323c){while(--_0x53323c){_0x1de914['push'](_0x1de914['shift']());}};_0x3647e8(++_0x4e0cef);}(a921_0x4e0c,0xf5));const a921_0x3647=function(_0x1de914,_0x4e0cef){_0x1de914=_0x1de914-0x0;let _0x3647e8=a921_0x4e0c[_0x1de914];return _0x3647e8;};const _0x4c6672=a921_0x3647;'use strict';const logger=require(_0x4c6672('0x27'))(_0x4c6672('0x8')),util=require(_0x4c6672('0x11')),path=require('path'),config=require(_0x4c6672('0x1e')),{Op}=require(_0x4c6672('0x1')),Sequence=function(){};Sequence[_0x4c6672('0x22')][_0x4c6672('0x29')]=function(_0x53323c){const _0x56fcbd=_0x4c6672;this[_0x56fcbd('0x14')]=this[_0x56fcbd('0x14')]?this[_0x56fcbd('0x14')][_0x56fcbd('0x6')](_0x53323c):_0x53323c();};const Migration=function(_0x5d82b2){const _0x509f68=_0x4c6672;this[_0x509f68('0x1a')]=_0x5d82b2,this['sequence']=new Sequence();};Migration[_0x4c6672('0x22')][_0x4c6672('0xe')]=function(_0x5c2413,_0x437bc5,_0x24e6a8){const _0x1a7225=_0x4c6672,_0x157923=this;this[_0x1a7225('0x2c')][_0x1a7225('0x29')](function(){const _0x291b46=_0x1a7225;return _0x157923[_0x291b46('0x1a')][_0x291b46('0xe')](_0x5c2413,_0x437bc5,_0x24e6a8)[_0x291b46('0xf')](function(){const _0x31d860=_0x291b46;logger[_0x31d860('0x12')](_0x31d860('0x13'),_0x437bc5,_0x5c2413);})['catch'](function(_0x4d21f3){const _0x274e98=_0x291b46;logger[_0x274e98('0x12')](JSON[_0x274e98('0x1d')](_0x4d21f3));});});},Migration[_0x4c6672('0x22')][_0x4c6672('0x16')]=function(_0x3ec77f,_0x134140,_0x2ee70b){const _0x12dd9c=_0x4c6672,_0x529542=this;this[_0x12dd9c('0x2c')][_0x12dd9c('0x29')](function(){const _0x1285ca=_0x12dd9c;return _0x529542[_0x1285ca('0x1a')]['addColumn'](_0x3ec77f,_0x134140,_0x2ee70b)[_0x1285ca('0xf')](function(){const _0x4f6ef9=_0x1285ca;logger[_0x4f6ef9('0x12')](_0x4f6ef9('0x1f'),_0x134140,_0x3ec77f);})[_0x1285ca('0x21')](function(_0x5e93fb){const _0x2a668a=_0x1285ca;logger['info'](JSON[_0x2a668a('0x1d')](_0x5e93fb));});});},Migration[_0x4c6672('0x22')]['dropTable']=function(_0x3ba713){const _0x443a96=_0x4c6672,_0x363945=this;this[_0x443a96('0x2c')][_0x443a96('0x29')](function(){const _0x3ac319=_0x443a96;return _0x363945['queryInterface'][_0x3ac319('0x17')](_0x3ba713,{'force':!![]})[_0x3ac319('0xf')](function(){const _0x1bb72c=_0x3ac319;logger[_0x1bb72c('0x12')](_0x1bb72c('0x28'),_0x3ba713);})[_0x3ac319('0x21')](function(_0x37b7fa){const _0x2f027e=_0x3ac319;logger['info'](JSON[_0x2f027e('0x1d')](_0x37b7fa));});});},Migration[_0x4c6672('0x22')]['addIndex']=function(_0x30a2bb,_0x564f8c,_0x41d4a9){const _0x299ede=_0x4c6672,_0x2b47c5=this;this[_0x299ede('0x2c')][_0x299ede('0x29')](function(){const _0x2d5e90=_0x299ede;return _0x2b47c5['queryInterface']['addIndex'](_0x30a2bb,_0x564f8c,{'indexName':_0x41d4a9})[_0x2d5e90('0xf')](function(){const _0x1b1b64=_0x2d5e90;logger[_0x1b1b64('0x12')]('addIndex\x20%s\x20%s\x20%s',_0x30a2bb,_0x564f8c[_0x1b1b64('0x1c')](','),_0x41d4a9);})[_0x2d5e90('0x21')](function(_0x3ca925){const _0x18ed21=_0x2d5e90;logger['info'](JSON[_0x18ed21('0x1d')](_0x3ca925));});});},Migration['prototype'][_0x4c6672('0x2e')]=function(_0x13b9b0){const _0x2c58ef=_0x4c6672,_0x1a2a45=this;this[_0x2c58ef('0x2c')]['enqueue'](function(){const _0x3eae84=_0x2c58ef;return _0x1a2a45[_0x3eae84('0x1a')][_0x3eae84('0x1')][_0x3eae84('0x2e')](_0x13b9b0)[_0x3eae84('0xf')](function(){const _0x14ef61=_0x3eae84;logger[_0x14ef61('0x12')](_0x14ef61('0x20'),_0x13b9b0);})[_0x3eae84('0x21')](function(_0x358fe8){const _0x208a77=_0x3eae84;logger[_0x208a77('0x12')](JSON[_0x208a77('0x1d')](_0x358fe8));});});},Migration[_0x4c6672('0x22')][_0x4c6672('0x19')]=function(_0x576449,_0x5e2617){const _0xd2268b=_0x4c6672,_0x2d4b9a=this;this[_0xd2268b('0x2c')][_0xd2268b('0x29')](function(){const _0x1acca7=_0xd2268b;return _0x2d4b9a[_0x1acca7('0x1a')][_0x1acca7('0x19')](_0x576449,_0x5e2617)[_0x1acca7('0xf')](function(){const _0x349286=_0x1acca7;logger[_0x349286('0x12')](_0x349286('0x0'),_0x5e2617,_0x576449);})[_0x1acca7('0x21')](function(_0x1b614b){const _0x49b3d8=_0x1acca7;logger[_0x49b3d8('0x12')](util[_0x49b3d8('0x15')](_0x1b614b,{'showHidden':![],'depth':null}));});});},Migration[_0x4c6672('0x22')][_0x4c6672('0x25')]=function(){const _0xfdffe3=_0x4c6672,_0x4d9031=this,_0x367f97=_0x4d9031[_0xfdffe3('0x1a')][_0xfdffe3('0x1')]['import'](path[_0xfdffe3('0x1c')](config['root'],_0xfdffe3('0x2a')));return _0x367f97[_0xfdffe3('0x4')]({'where':{'type':{[Op[_0xfdffe3('0xd')]]:[_0xfdffe3('0x10'),_0xfdffe3('0xb')]}},'attributes':['id']})['then'](function(_0x59f6f2){return _0x59f6f2;})['catch'](function(_0x6e2481){const _0x536575=_0xfdffe3;logger['info'](JSON[_0x536575('0x1d')](_0x6e2481));});},Migration[_0x4c6672('0x22')][_0x4c6672('0x9')]=function(_0x456bc9){const _0x511df1=_0x4c6672;this[_0x511df1('0x2c')]['enqueue'](function(){return _0x456bc9();});},module['exports']={'up':function(_0x4f872e,_0x3b3ca4){return new Promise(function(_0x24b319){const _0x38ee7b=a921_0x3647,_0x57483d=new Migration(_0x4f872e);_0x57483d[_0x38ee7b('0x16')](_0x38ee7b('0x7'),_0x38ee7b('0x3'),{'type':_0x3b3ca4[_0x38ee7b('0x5')],'defaultValue':_0x38ee7b('0x2b')}),_0x57483d[_0x38ee7b('0x16')](_0x38ee7b('0x2d'),_0x38ee7b('0xa'),{'type':_0x3b3ca4[_0x38ee7b('0x2')],'defaultValue':![]}),_0x57483d['getCustomFields']()[_0x38ee7b('0xf')](function(_0x104728){const _0x409869=_0x38ee7b;if(_0x104728)for(let _0x4b8da4=0x0,_0x43da6b=_0x104728[_0x409869('0x1b')];_0x4b8da4<_0x43da6b;_0x4b8da4++){_0x57483d[_0x409869('0xe')](_0x409869('0xc'),_0x409869('0x24')+_0x104728[_0x4b8da4]['id'],{'type':_0x3b3ca4['TEXT']});}}),_0x57483d[_0x38ee7b('0x16')](_0x38ee7b('0x18'),'failMessage',{'type':_0x3b3ca4[_0x38ee7b('0x23')]}),_0x57483d[_0x38ee7b('0x16')](_0x38ee7b('0x26'),'extensionMonitor',{'type':_0x3b3ca4[_0x38ee7b('0x5')],'defaultValue':''}),_0x57483d[_0x38ee7b('0x9')](_0x24b319);});},'down':function(){}};