Built motion from commit be44e1e4d16f8b29d243415b03d27262d8601e0e. Version 3.0.0...
[motion-next.git] / server / migrations / 2.0.66.js
1 const a945_0x3400=['cm_contacts','info','../config/logger','TEXT','removeColumn','analytics_report_fields','settings','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','prototype','migration','exports','inspect','addColumn','long','removeIndex\x20%s\x20%s','agentTransferTimeout','Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s','mail_interactions','finally','splitSizeXlsx','Changed\x20column\x20%s\x20in\x20table\x20%s','field','stringify','INTEGER','changeColumn','renameColumn','splitSizePdf','phoneBarPrefixRequired','queueTransfer','addIndex\x20%s\x20%s\x20%s','BOOLEAN','tools_schedules','Added\x20column\x20%s\x20to\x20%s','then','split','queryInterface','enqueue','tail','removeIndex','query','agentTransfer','splitSizeCsv','catch','table\x20dropped\x20%s','queueTransferTimeout','sequence','final','lastMsgBody','sequelize','mail_accounts'];(function(_0x459374,_0x3400c7){const _0x5d7f54=function(_0x4bc0da){while(--_0x4bc0da){_0x459374['push'](_0x459374['shift']());}};_0x5d7f54(++_0x3400c7);}(a945_0x3400,0x6e));const a945_0x5d7f=function(_0x459374,_0x3400c7){_0x459374=_0x459374-0x0;let _0x5d7f54=a945_0x3400[_0x459374];return _0x5d7f54;};const _0x46a533=a945_0x5d7f;'use strict';const util=require('util'),logger=require(_0x46a533('0x2a'))(_0x46a533('0x31')),Sequence=function(){};Sequence[_0x46a533('0x30')][_0x46a533('0x1a')]=function(_0x4bc0da){const _0x43677c=_0x46a533;this[_0x43677c('0x1b')]=this[_0x43677c('0x1b')]?this[_0x43677c('0x1b')][_0x43677c('0x8')](_0x4bc0da):_0x4bc0da();};const Migration=function(_0x55f6e3){const _0x5995d5=_0x46a533;this['queryInterface']=_0x55f6e3,this[_0x5995d5('0x23')]=new Sequence();};Migration['prototype']['changeColumn']=function(_0x521830,_0x2f5881,_0x1900f5){const _0x4ac7e7=_0x46a533,_0x320d99=this;this[_0x4ac7e7('0x23')][_0x4ac7e7('0x1a')](function(){const _0x999cf5=_0x4ac7e7;return _0x320d99[_0x999cf5('0x19')][_0x999cf5('0xe')](_0x521830,_0x2f5881,_0x1900f5)[_0x999cf5('0x17')](function(){const _0x346788=_0x999cf5;logger[_0x346788('0x29')](_0x346788('0xa'),_0x2f5881,_0x521830);})[_0x999cf5('0x20')](function(_0x20a3e8){const _0x5a436b=_0x999cf5;logger[_0x5a436b('0x29')](JSON[_0x5a436b('0xc')](_0x20a3e8));});});},Migration['prototype']['addColumn']=function(_0x5240e9,_0x56402f,_0x3228a0){const _0x5c7377=_0x46a533,_0x1ca6bd=this;this[_0x5c7377('0x23')][_0x5c7377('0x1a')](function(){const _0x5bc2d7=_0x5c7377;return _0x1ca6bd[_0x5bc2d7('0x19')][_0x5bc2d7('0x2')](_0x5240e9,_0x56402f,_0x3228a0)[_0x5bc2d7('0x17')](function(){const _0x3d3a1a=_0x5bc2d7;logger[_0x3d3a1a('0x29')](_0x3d3a1a('0x16'),_0x56402f,_0x5240e9);})[_0x5bc2d7('0x20')](function(_0x3d8f23){const _0x3a4d12=_0x5bc2d7;logger[_0x3a4d12('0x29')](JSON[_0x3a4d12('0xc')](_0x3d8f23));});});},Migration[_0x46a533('0x30')]['dropTable']=function(_0x4c4e48){const _0x3238f4=_0x46a533,_0x33629c=this;this['sequence'][_0x3238f4('0x1a')](function(){const _0x20663e=_0x3238f4;return _0x33629c[_0x20663e('0x19')]['dropTable'](_0x4c4e48,{'force':!![]})['then'](function(){const _0x178b04=_0x20663e;logger[_0x178b04('0x29')](_0x178b04('0x21'),_0x4c4e48);})[_0x20663e('0x20')](function(_0x294290){const _0x5e4812=_0x20663e;logger['info'](JSON[_0x5e4812('0xc')](_0x294290));});});},Migration[_0x46a533('0x30')]['addIndex']=function(_0x39dc85,_0x4c0004,_0x5d98c3){const _0x17bb3d=_0x46a533,_0x2c809e=this;this[_0x17bb3d('0x23')][_0x17bb3d('0x1a')](function(){const _0x4d4fb6=_0x17bb3d;return _0x2c809e['queryInterface']['addIndex'](_0x39dc85,_0x4c0004,{'indexName':_0x5d98c3})[_0x4d4fb6('0x17')](function(){const _0x3c80c6=_0x4d4fb6;logger[_0x3c80c6('0x29')](_0x3c80c6('0x13'),_0x39dc85,_0x4c0004['join'](','),_0x5d98c3);})[_0x4d4fb6('0x20')](function(_0x299856){const _0x2e02ff=_0x4d4fb6;logger[_0x2e02ff('0x29')](JSON['stringify'](_0x299856));});});},Migration[_0x46a533('0x30')][_0x46a533('0x1c')]=function(_0x19018f,_0x3a59c1){const _0x4ce2b8=_0x46a533,_0x4808e7=this;this[_0x4ce2b8('0x23')][_0x4ce2b8('0x1a')](function(){const _0x360443=_0x4ce2b8;return _0x4808e7[_0x360443('0x19')][_0x360443('0x1c')](_0x19018f,_0x3a59c1)[_0x360443('0x17')](function(){const _0x86e6f2=_0x360443;logger[_0x86e6f2('0x29')](_0x86e6f2('0x4'),_0x19018f,_0x3a59c1);})[_0x360443('0x20')](function(_0x4537dd){const _0x4337a4=_0x360443;logger[_0x4337a4('0x29')](JSON[_0x4337a4('0xc')](_0x4537dd));});});},Migration[_0x46a533('0x30')]['query']=function(_0x3ccf02){const _0x4f357f=_0x46a533,_0x3d84e4=this;this[_0x4f357f('0x23')][_0x4f357f('0x1a')](function(){const _0x35bc57=_0x4f357f;return _0x3d84e4[_0x35bc57('0x19')][_0x35bc57('0x26')][_0x35bc57('0x1d')](_0x3ccf02)[_0x35bc57('0x17')](function(){const _0x6a3282=_0x35bc57;logger[_0x6a3282('0x29')]('query\x20%s',_0x3ccf02);})[_0x35bc57('0x20')](function(_0x4dbba4){const _0x5b8e6d=_0x35bc57;logger[_0x5b8e6d('0x29')](JSON[_0x5b8e6d('0xc')](_0x4dbba4));});});},Migration[_0x46a533('0x30')]['removeColumn']=function(_0x335665,_0x11d24f){const _0x56bf2f=_0x46a533,_0x1e3322=this;this[_0x56bf2f('0x23')]['enqueue'](function(){const _0x1984be=_0x56bf2f;return _0x1e3322[_0x1984be('0x19')][_0x1984be('0x2c')](_0x335665,_0x11d24f)[_0x1984be('0x17')](function(){logger['info']('Removed\x20column\x20%s\x20from\x20%s',_0x11d24f,_0x335665);})['catch'](function(_0x14fec9){const _0x582ace=_0x1984be;logger[_0x582ace('0x29')](util[_0x582ace('0x1')](_0x14fec9,{'showHidden':![],'depth':null}));});});},Migration[_0x46a533('0x30')][_0x46a533('0xf')]=function(_0x249fba,_0x4c52ca,_0x3acc50){const _0x2c4bc0=_0x46a533,_0x3c69a4=this;this[_0x2c4bc0('0x23')][_0x2c4bc0('0x1a')](function(){const _0x152dd4=_0x2c4bc0;return _0x3c69a4[_0x152dd4('0x19')][_0x152dd4('0xf')](_0x249fba,_0x4c52ca,_0x3acc50)['then'](function(){const _0x43e877=_0x152dd4;logger[_0x43e877('0x29')](_0x43e877('0x6'),_0x4c52ca,_0x3acc50,_0x249fba);})['catch'](function(_0x525063){const _0x4311df=_0x152dd4;logger[_0x4311df('0x29')](util[_0x4311df('0x1')](_0x525063,{'showHidden':![],'depth':null}));});});},Migration[_0x46a533('0x30')]['final']=function(_0x57bc70){const _0x307681=_0x46a533;this['sequence'][_0x307681('0x1a')](function(){return _0x57bc70();});},module[_0x46a533('0x0')]={'up':function(_0xe9690,_0x53bb15){return new Promise(function(_0x14b0a8){const _0x11476f=a945_0x5d7f,_0x45c56e=new Migration(_0xe9690);_0x45c56e['changeColumn'](_0x11476f('0x2d'),_0x11476f('0xb'),{'type':_0x53bb15[_0x11476f('0x2b')]}),_0x45c56e[_0x11476f('0x2')]('tools_schedules','cc',{'type':_0x53bb15[_0x11476f('0x2b')]}),_0x45c56e[_0x11476f('0x2')](_0x11476f('0x15'),'bcc',{'type':_0x53bb15[_0x11476f('0x2b')]}),_0x45c56e[_0x11476f('0x2')](_0x11476f('0x2e'),_0x11476f('0x18'),{'type':_0x53bb15[_0x11476f('0x14')],'defaultValue':!![]}),_0x45c56e[_0x11476f('0x2')](_0x11476f('0x2e'),_0x11476f('0x1f'),{'type':_0x53bb15['INTEGER'],'defaultValue':0x1388}),_0x45c56e[_0x11476f('0x2')](_0x11476f('0x2e'),_0x11476f('0x10'),{'type':_0x53bb15[_0x11476f('0xd')],'defaultValue':0x3e8}),_0x45c56e[_0x11476f('0x2')](_0x11476f('0x2e'),_0x11476f('0x9'),{'type':_0x53bb15['INTEGER'],'defaultValue':0x1388}),_0x45c56e['addColumn']('mail_accounts',_0x11476f('0x12'),{'type':_0x53bb15['BOOLEAN'],'defaultValue':![]}),_0x45c56e[_0x11476f('0x2')](_0x11476f('0x27'),_0x11476f('0x22'),{'type':_0x53bb15[_0x11476f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}),_0x45c56e[_0x11476f('0x2')](_0x11476f('0x27'),_0x11476f('0x1e'),{'type':_0x53bb15['BOOLEAN'],'defaultValue':![]}),_0x45c56e['addColumn'](_0x11476f('0x27'),_0x11476f('0x5'),{'type':_0x53bb15['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}),_0x45c56e[_0x11476f('0x2')]('users',_0x11476f('0x11'),{'type':_0x53bb15['BOOLEAN'],'defaultValue':![]}),_0x45c56e[_0x11476f('0xe')](_0x11476f('0x7'),'subject',{'type':_0x53bb15[_0x11476f('0x2b')]('')+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'}),_0x45c56e[_0x11476f('0xe')](_0x11476f('0x7'),_0x11476f('0x25'),{'type':_0x53bb15[_0x11476f('0x2b')](_0x11476f('0x3'))+_0x11476f('0x2f')}),_0x45c56e[_0x11476f('0x2')](_0x11476f('0x28'),'viber',{'type':_0x53bb15['STRING']}),_0x45c56e[_0x11476f('0x24')](_0x14b0a8);});},'down':function(){}};