544f81894fe1e9a78e7a696fd3438d9206dd52a1
[motion-next.git] / server / migrations / 2.5.5.js
1 const a1018_0x2868=['report_call','userSecondDisposition','sequelize','ALTER\x20TABLE\x20tools_dispositions\x20ADD\x20CONSTRAINT\x20`tools_dispositions_ibfk_8`\x20FOREIGN\x20KEY\x20(`ParentId`)\x20REFERENCES\x20`tools_dispositions`\x20(`id`)\x20ON\x20DELETE\x20CASCADE\x20ON\x20UPDATE\x20CASCADE','UPDATE\x20tools_actions\x20SET\x20data4\x20=\x20\x27phone\x27\x20WHERE\x20action\x20=\x20\x27contactManager\x27\x20AND\x20data4\x20=\x20\x270\x27','sms_interactions','queryInterface','inspect','join','info','dropTable','renameColumn','then','first','Changed\x20column\x20%s\x20in\x20table\x20%s','name','settings','stringify','voice_recordings','prototype','sequence','voice','ENUM','openchannel_interactions','enqueue','second','addIndex','UPDATE\x20tools_actions\x20SET\x20data3\x20=\x20\x27phone\x27\x20WHERE\x20action\x20=\x20\x27contactManager\x27\x20AND\x20data3\x20=\x20\x270\x27','cm_hopper_final','chat_interactions','Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s','clickToAction','../config/logger','finally','updatedAt','ParentId','final','fax_interactions','exports','table\x20dropped\x20%s','enforcePasswordHistory','userThirdDisposition','users','tools_dispositions','actionType','query\x20%s','third','level','Added\x20column\x20%s\x20to\x20%s','passwordResetAt','UNSIGNED','migration','mail_interactions','secondDisposition','STRING','previousPasswords','cm_custom_fields','query','indicesType','thirdDisposition','indexName','Removed\x20column\x20%s\x20from\x20%s','BOOLEAN','disposition','changeColumn','removeColumn','removeIndex','addColumn','tail','userDisposition','catch','report_queue','util','INTEGER'];(function(_0x39b23f,_0x2868fb){const _0x3bcda1=function(_0x2839ba){while(--_0x2839ba){_0x39b23f['push'](_0x39b23f['shift']());}};_0x3bcda1(++_0x2868fb);}(a1018_0x2868,0x13a));const a1018_0x3bcd=function(_0x39b23f,_0x2868fb){_0x39b23f=_0x39b23f-0x0;let _0x3bcda1=a1018_0x2868[_0x39b23f];return _0x3bcda1;};const _0x3c11d7=a1018_0x3bcd;'use strict';const util=require(_0x3c11d7('0x36')),logger=require(_0x3c11d7('0xe'))(_0x3c11d7('0x21')),Sequence=function(){};Sequence[_0x3c11d7('0x1')]['enqueue']=function(_0x2839ba){const _0x183d57=_0x3c11d7;this[_0x183d57('0x32')]=this[_0x183d57('0x32')]?this[_0x183d57('0x32')][_0x183d57('0xf')](_0x2839ba):_0x2839ba();};const Migration=function(_0x24a9a6){const _0x5ecc95=_0x3c11d7;this[_0x5ecc95('0x3e')]=_0x24a9a6,this[_0x5ecc95('0x2')]=new Sequence();};Migration['prototype'][_0x3c11d7('0x2e')]=function(_0x4b7b95,_0x36cde1,_0x2d8c19){const _0x3ac0ec=_0x3c11d7,_0x4417fb=this;this[_0x3ac0ec('0x2')][_0x3ac0ec('0x6')](function(){const _0x1b125a=_0x3ac0ec;return _0x4417fb[_0x1b125a('0x3e')]['changeColumn'](_0x4b7b95,_0x36cde1,_0x2d8c19)['then'](function(){const _0x2f0d0e=_0x1b125a;logger[_0x2f0d0e('0x41')](_0x2f0d0e('0x46'),_0x36cde1,_0x4b7b95);})[_0x1b125a('0x34')](function(_0x5f26c4){const _0x29eb75=_0x1b125a;logger[_0x29eb75('0x41')](JSON['stringify'](_0x5f26c4));});});},Migration[_0x3c11d7('0x1')][_0x3c11d7('0x31')]=function(_0x76e229,_0x5e736a,_0x1940b0){const _0x1c9909=_0x3c11d7,_0xb962cd=this;this[_0x1c9909('0x2')][_0x1c9909('0x6')](function(){const _0x1408e4=_0x1c9909;return _0xb962cd[_0x1408e4('0x3e')][_0x1408e4('0x31')](_0x76e229,_0x5e736a,_0x1940b0)[_0x1408e4('0x44')](function(){const _0xc69433=_0x1408e4;logger[_0xc69433('0x41')](_0xc69433('0x1e'),_0x5e736a,_0x76e229);})[_0x1408e4('0x34')](function(_0x431a4a){const _0x1236e0=_0x1408e4;logger[_0x1236e0('0x41')](JSON[_0x1236e0('0x49')](_0x431a4a));});});},Migration[_0x3c11d7('0x1')][_0x3c11d7('0x42')]=function(_0x41445c){const _0x45a64c=_0x3c11d7,_0x363020=this;this[_0x45a64c('0x2')][_0x45a64c('0x6')](function(){const _0x7d4b48=_0x45a64c;return _0x363020[_0x7d4b48('0x3e')][_0x7d4b48('0x42')](_0x41445c,{'force':!![]})[_0x7d4b48('0x44')](function(){const _0x46124e=_0x7d4b48;logger[_0x46124e('0x41')](_0x46124e('0x15'),_0x41445c);})['catch'](function(_0x3e2229){const _0x4f3d7a=_0x7d4b48;logger[_0x4f3d7a('0x41')](JSON[_0x4f3d7a('0x49')](_0x3e2229));});});},Migration[_0x3c11d7('0x1')][_0x3c11d7('0x8')]=function(_0x41dda7,_0x3fe15d,_0x4832f3){const _0x2cbdff=_0x3c11d7,_0x4ae68e=this;this[_0x2cbdff('0x2')]['enqueue'](function(){const _0x4d08d0=_0x2cbdff;return _0x4ae68e[_0x4d08d0('0x3e')][_0x4d08d0('0x8')](_0x41dda7,_0x3fe15d,{'indexName':_0x4832f3[_0x4d08d0('0x2a')],'indicesType':_0x4832f3[_0x4d08d0('0x28')]})['then'](function(){const _0x4bc227=_0x4d08d0;logger[_0x4bc227('0x41')]('addIndex\x20%s\x20%s\x20%s\x20[%s]',_0x41dda7,_0x3fe15d[_0x4bc227('0x40')](','),_0x4832f3[_0x4bc227('0x2a')],_0x4832f3[_0x4bc227('0x28')]);})[_0x4d08d0('0x34')](function(_0x19305b){logger['info'](JSON['stringify'](_0x19305b));});});},Migration[_0x3c11d7('0x1')][_0x3c11d7('0x30')]=function(_0x446ff8,_0x1a70dd){const _0x56a45a=_0x3c11d7,_0x42fe5b=this;this[_0x56a45a('0x2')][_0x56a45a('0x6')](function(){const _0x19ca73=_0x56a45a;return _0x42fe5b['queryInterface']['removeIndex'](_0x446ff8,_0x1a70dd)['then'](function(){const _0x1cf974=a1018_0x3bcd;logger[_0x1cf974('0x41')]('removeIndex\x20%s\x20%s',_0x446ff8,_0x1a70dd);})[_0x19ca73('0x34')](function(_0x5047dc){const _0x6133c6=_0x19ca73;logger[_0x6133c6('0x41')](JSON[_0x6133c6('0x49')](_0x5047dc));});});},Migration['prototype'][_0x3c11d7('0x27')]=function(_0x5ae291){const _0x2f235b=this;this['sequence']['enqueue'](function(){const _0x59a1eb=a1018_0x3bcd;return _0x2f235b[_0x59a1eb('0x3e')][_0x59a1eb('0x3a')]['query'](_0x5ae291)[_0x59a1eb('0x44')](function(){const _0x5540ff=_0x59a1eb;logger[_0x5540ff('0x41')](_0x5540ff('0x1b'),_0x5ae291);})['catch'](function(_0x22cab9){const _0x13805e=_0x59a1eb;logger[_0x13805e('0x41')](JSON[_0x13805e('0x49')](_0x22cab9));});});},Migration['prototype'][_0x3c11d7('0x2f')]=function(_0x999bee,_0x23958d){const _0x2617c2=_0x3c11d7,_0x497e33=this;this[_0x2617c2('0x2')][_0x2617c2('0x6')](function(){const _0x2f89e5=_0x2617c2;return _0x497e33[_0x2f89e5('0x3e')][_0x2f89e5('0x2f')](_0x999bee,_0x23958d)[_0x2f89e5('0x44')](function(){const _0x15dcd5=_0x2f89e5;logger[_0x15dcd5('0x41')](_0x15dcd5('0x2b'),_0x23958d,_0x999bee);})['catch'](function(_0x2e38f4){const _0x58ed0e=_0x2f89e5;logger[_0x58ed0e('0x41')](util[_0x58ed0e('0x3f')](_0x2e38f4,{'showHidden':![],'depth':null}));});});},Migration[_0x3c11d7('0x1')][_0x3c11d7('0x43')]=function(_0x5ed7b5,_0x56fb6f,_0x3fdf92){const _0x18867c=_0x3c11d7,_0xfb897b=this;this[_0x18867c('0x2')][_0x18867c('0x6')](function(){const _0xaa53b0=_0x18867c;return _0xfb897b[_0xaa53b0('0x3e')][_0xaa53b0('0x43')](_0x5ed7b5,_0x56fb6f,_0x3fdf92)[_0xaa53b0('0x44')](function(){const _0x536f0a=_0xaa53b0;logger[_0x536f0a('0x41')](_0x536f0a('0xc'),_0x56fb6f,_0x3fdf92,_0x5ed7b5);})['catch'](function(_0x24c911){const _0x30e875=_0xaa53b0;logger[_0x30e875('0x41')](util['inspect'](_0x24c911,{'showHidden':![],'depth':null}));});});},Migration[_0x3c11d7('0x1')][_0x3c11d7('0x12')]=function(_0x22f14d){const _0x3706b1=_0x3c11d7;this[_0x3706b1('0x2')]['enqueue'](function(){return _0x22f14d();});},module[_0x3c11d7('0x14')]={'up':function(_0x4f3240,_0x313b1b){return new Promise(function(_0x2e70f7){const _0x8a0758=a1018_0x3bcd,_0x586ae9=new Migration(_0x4f3240);_0x586ae9[_0x8a0758('0x27')](_0x8a0758('0x9')),_0x586ae9['query']('UPDATE\x20tools_actions\x20SET\x20data4\x20=\x20NULL\x20WHERE\x20action\x20=\x20\x27contactManager\x27\x20AND\x20data2\x20=\x20\x270\x27\x20AND\x20data4\x20=\x20\x270\x27'),_0x586ae9[_0x8a0758('0x27')](_0x8a0758('0x3c')),_0x586ae9[_0x8a0758('0x31')]('settings',_0x8a0758('0x16'),{'type':_0x313b1b[_0x8a0758('0x2c')],'defaultValue':!![]}),_0x586ae9['addColumn'](_0x8a0758('0x48'),'passwordHistoryLimit',{'type':_0x313b1b[_0x8a0758('0x37')](0x2)[_0x8a0758('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}}),_0x586ae9['addColumn']('users',_0x8a0758('0x25'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':_0x8a0758('0x1f')}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x18'),'settingsEnabled',{'type':_0x313b1b['BOOLEAN'],'defaultValue':!![]}),_0x586ae9[_0x8a0758('0x31')]('cm_custom_fields',_0x8a0758('0xd'),{'type':_0x313b1b[_0x8a0758('0x2c')],'defaultValue':![]}),_0x586ae9['addColumn'](_0x8a0758('0x26'),_0x8a0758('0x1a'),{'type':_0x313b1b[_0x8a0758('0x4')](_0x8a0758('0x3')),'allowNull':![],'defaultValue':_0x8a0758('0x3')}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x19'),_0x8a0758('0x1d'),{'type':_0x313b1b[_0x8a0758('0x4')](_0x8a0758('0x45'),_0x8a0758('0x7'),_0x8a0758('0x1c')),'allowNull':![],'defaultValue':_0x8a0758('0x45'),'after':_0x8a0758('0x47')}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x19'),'description',{'type':_0x313b1b['STRING'],'after':_0x8a0758('0x1d')}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x19'),_0x8a0758('0x11'),{'type':_0x313b1b['INTEGER'],'after':_0x8a0758('0x10')}),_0x586ae9['query'](_0x8a0758('0x3b')),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x38'),_0x8a0758('0x39'),{'type':_0x313b1b['STRING'],'after':_0x8a0758('0x33')}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x38'),_0x8a0758('0x17'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':_0x8a0758('0x39')}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x35'),'secondDisposition',{'type':_0x313b1b[_0x8a0758('0x24')],'after':_0x8a0758('0x2d')}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x35'),_0x8a0758('0x29'),{'type':_0x313b1b['STRING'],'after':_0x8a0758('0x23')}),_0x586ae9['addColumn'](_0x8a0758('0x0'),_0x8a0758('0x39'),{'type':_0x313b1b['STRING'],'after':_0x8a0758('0x33')}),_0x586ae9[_0x8a0758('0x31')]('voice_recordings',_0x8a0758('0x17'),{'type':_0x313b1b['STRING'],'after':'userSecondDisposition'}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0xb'),_0x8a0758('0x23'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':_0x8a0758('0x2d')}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0xb'),'thirdDisposition',{'type':_0x313b1b[_0x8a0758('0x24')],'after':'secondDisposition'}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x13'),'secondDisposition',{'type':_0x313b1b[_0x8a0758('0x24')],'after':_0x8a0758('0x2d')}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x13'),_0x8a0758('0x29'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':'secondDisposition'}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x22'),_0x8a0758('0x23'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':_0x8a0758('0x2d')}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0x22'),_0x8a0758('0x29'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':'secondDisposition'}),_0x586ae9['addColumn'](_0x8a0758('0x5'),_0x8a0758('0x23'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':_0x8a0758('0x2d')}),_0x586ae9[_0x8a0758('0x31')]('openchannel_interactions',_0x8a0758('0x29'),{'type':_0x313b1b['STRING'],'after':_0x8a0758('0x23')}),_0x586ae9['addColumn'](_0x8a0758('0x3d'),_0x8a0758('0x23'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':_0x8a0758('0x2d')}),_0x586ae9['addColumn'](_0x8a0758('0x3d'),_0x8a0758('0x29'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':'secondDisposition'}),_0x586ae9['addColumn']('whatsapp_interactions',_0x8a0758('0x23'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':'disposition'}),_0x586ae9['addColumn']('whatsapp_interactions',_0x8a0758('0x29'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':'secondDisposition'}),_0x586ae9[_0x8a0758('0x31')](_0x8a0758('0xa'),_0x8a0758('0x23'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':_0x8a0758('0x2d')}),_0x586ae9['addColumn'](_0x8a0758('0xa'),_0x8a0758('0x29'),{'type':_0x313b1b[_0x8a0758('0x24')],'after':_0x8a0758('0x23')}),_0x586ae9[_0x8a0758('0x12')](_0x2e70f7);});},'down':function(){}};