d6238e6a50eb5c4ccc0f2ea1a85482e366654f14
[motion-next.git] / server / migrations / 2.0.31.js
1 const a910_0x19a3=['prototype','FORWARD,\x20BLIND,\x20ATTENDED','chat_websites','facebook','team_has_sms_queues','questionId','query\x20%s','queryInterface','Added\x20column\x20%s\x20to\x20%s','info','token','phoneBarUnansweredCallBadge','sms_queues','transferuniqueid','addColumn','ALTER\x20TABLE\x20chat_websites\x20ADD\x20CONSTRAINT\x20chat_websites_ibfk_2\x20FOREIGN\x20KEY\x20(IntervalId)\x20REFERENCES\x20tools_intervals(id)\x20ON\x20UPDATE\x20CASCADE\x20ON\x20DELETE\x20SET\x20NULL','Changed\x20column\x20%s\x20in\x20table\x20%s','stringify','report_queue','sms_dispositions','join','dropTable','timezone','STRING','final','sms_accounts','then','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-preview\x27,\x20\x271\x27,\x20\x27NoOp\x27,\x20\x27\x27,\x20\x27system\x27,\x20\x27Dialer\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','enqueue','table\x20dropped\x20%s','user_has_sms_interactions','changeColumn','sms_applications','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-preview\x27,\x20\x272\x27,\x20\x27set\x27,\x20\x27CDR(type)=dialer\x27,\x20\x27system\x27,\x20\x27Dialer\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','catch','exports','sms_interactions','sequence','user_has_sms_queues','cm_contacts','BOOLEAN','addIndex','sequelize','../config/logger','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-preview\x27,\x20\x275\x27,\x20\x27hangup\x27,\x20\x27system\x27,\x20\x27dialer\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','ALTER\x20TABLE\x20chat_websites\x20DROP\x20FOREIGN\x20KEY\x20chat_websites_ibfk_2','tail','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-preview\x27,\x20\x274\x27,\x20\x27dial\x27,\x20\x27${XMD-DIALCHANNEL},${XMD-DIALTIMEOUT},${XMD-DIALOPTIONS},${XMD-DIALURL}\x27,\x20\x27system\x27,\x20\x27Dialer\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','query'];(function(_0x1aeedf,_0x19a39c){const _0x7b4688=function(_0x4681a1){while(--_0x4681a1){_0x1aeedf['push'](_0x1aeedf['shift']());}};_0x7b4688(++_0x19a39c);}(a910_0x19a3,0x15e));const a910_0x7b46=function(_0x1aeedf,_0x19a39c){_0x1aeedf=_0x1aeedf-0x0;let _0x7b4688=a910_0x19a3[_0x1aeedf];return _0x7b4688;};const _0x75d7fc=a910_0x7b46;'use strict';const logger=require(_0x75d7fc('0x24'))('migration'),Sequence=function(){};Sequence[_0x75d7fc('0x2a')][_0x75d7fc('0x15')]=function(_0x4681a1){const _0x2bf0ab=_0x75d7fc;this[_0x2bf0ab('0x27')]=this[_0x2bf0ab('0x27')]?this[_0x2bf0ab('0x27')]['finally'](_0x4681a1):_0x4681a1();};const Migration=function(_0x4690c3){const _0x30cb13=_0x75d7fc;this[_0x30cb13('0x0')]=_0x4690c3,this[_0x30cb13('0x1e')]=new Sequence();};Migration['prototype'][_0x75d7fc('0x18')]=function(_0x1757e7,_0x14fd35,_0x183bd7){const _0x5b6407=_0x75d7fc,_0xfcfa92=this;this[_0x5b6407('0x1e')][_0x5b6407('0x15')](function(){const _0x437121=_0x5b6407;return _0xfcfa92[_0x437121('0x0')][_0x437121('0x18')](_0x1757e7,_0x14fd35,_0x183bd7)['then'](function(){const _0x3f2704=_0x437121;logger[_0x3f2704('0x2')](_0x3f2704('0x9'),_0x14fd35,_0x1757e7);})['catch'](function(_0xec6b99){const _0x562f74=_0x437121;logger[_0x562f74('0x2')](JSON['stringify'](_0xec6b99));});});},Migration['prototype'][_0x75d7fc('0x7')]=function(_0x573b38,_0x1e795b,_0x33d547){const _0xe78f37=_0x75d7fc,_0x3a952c=this;this[_0xe78f37('0x1e')][_0xe78f37('0x15')](function(){const _0x17e71c=_0xe78f37;return _0x3a952c[_0x17e71c('0x0')]['addColumn'](_0x573b38,_0x1e795b,_0x33d547)[_0x17e71c('0x13')](function(){const _0x14f2fe=_0x17e71c;logger['info'](_0x14f2fe('0x1'),_0x1e795b,_0x573b38);})[_0x17e71c('0x1b')](function(_0x2b7a5d){const _0x59b587=_0x17e71c;logger[_0x59b587('0x2')](JSON[_0x59b587('0xa')](_0x2b7a5d));});});},Migration[_0x75d7fc('0x2a')][_0x75d7fc('0xe')]=function(_0x574225){const _0x2c4be5=_0x75d7fc,_0x2a21c9=this;this[_0x2c4be5('0x1e')][_0x2c4be5('0x15')](function(){const _0x850d2=_0x2c4be5;return _0x2a21c9[_0x850d2('0x0')]['dropTable'](_0x574225,{'force':!![]})[_0x850d2('0x13')](function(){const _0x5a5b2b=_0x850d2;logger[_0x5a5b2b('0x2')](_0x5a5b2b('0x16'),_0x574225);})['catch'](function(_0x493493){const _0x3c0cce=_0x850d2;logger['info'](JSON[_0x3c0cce('0xa')](_0x493493));});});},Migration[_0x75d7fc('0x2a')][_0x75d7fc('0x22')]=function(_0x4a5d54,_0x40a46a,_0x500eaa){const _0x2b1eb0=_0x75d7fc,_0x2f882b=this;this[_0x2b1eb0('0x1e')]['enqueue'](function(){const _0xfe68a4=_0x2b1eb0;return _0x2f882b['queryInterface'][_0xfe68a4('0x22')](_0x4a5d54,_0x40a46a,{'indexName':_0x500eaa})['then'](function(){const _0x311019=_0xfe68a4;logger[_0x311019('0x2')]('addIndex\x20%s\x20%s\x20%s',_0x4a5d54,_0x40a46a[_0x311019('0xd')](','),_0x500eaa);})['catch'](function(_0x56e327){const _0xa7323f=_0xfe68a4;logger[_0xa7323f('0x2')](JSON['stringify'](_0x56e327));});});},Migration[_0x75d7fc('0x2a')][_0x75d7fc('0x29')]=function(_0x296dc1){const _0x36570a=_0x75d7fc,_0x54bc14=this;this[_0x36570a('0x1e')][_0x36570a('0x15')](function(){const _0x3467da=_0x36570a;return _0x54bc14[_0x3467da('0x0')][_0x3467da('0x23')]['query'](_0x296dc1)[_0x3467da('0x13')](function(){const _0x5a42b1=_0x3467da;logger[_0x5a42b1('0x2')](_0x5a42b1('0x30'),_0x296dc1);})[_0x3467da('0x1b')](function(_0x539077){const _0x43f210=_0x3467da;logger['info'](JSON[_0x43f210('0xa')](_0x539077));});});},Migration['prototype'][_0x75d7fc('0x11')]=function(_0x1c6b32){const _0x2663d7=_0x75d7fc;this['sequence'][_0x2663d7('0x15')](function(){return _0x1c6b32();});},module[_0x75d7fc('0x1c')]={'up':function(_0x3583d1,_0x1f5ba7){return new Promise(function(_0x44df5f){const _0x608347=a910_0x7b46,_0x391131=new Migration(_0x3583d1);_0x391131[_0x608347('0xe')]('sms_messages'),_0x391131[_0x608347('0xe')](_0x608347('0xc')),_0x391131[_0x608347('0xe')](_0x608347('0x19')),_0x391131[_0x608347('0xe')](_0x608347('0x17')),_0x391131[_0x608347('0xe')](_0x608347('0x1d')),_0x391131[_0x608347('0xe')](_0x608347('0x2e')),_0x391131[_0x608347('0xe')](_0x608347('0x1f')),_0x391131['dropTable'](_0x608347('0x5')),_0x391131[_0x608347('0xe')](_0x608347('0x12')),_0x391131[_0x608347('0x7')]('cm_contacts',_0x608347('0x2d'),{'type':_0x1f5ba7[_0x608347('0x10')]}),_0x391131[_0x608347('0x7')](_0x608347('0x20'),'twitter',{'type':_0x1f5ba7[_0x608347('0x10')]}),_0x391131['query'](_0x608347('0x26')),_0x391131[_0x608347('0x29')]('ALTER\x20TABLE\x20chat_websites\x20DROP\x20COLUMN\x20OfflineTemplateId'),_0x391131['addColumn'](_0x608347('0x2c'),_0x608347('0xf'),{'type':_0x1f5ba7[_0x608347('0x10')]}),_0x391131[_0x608347('0x7')](_0x608347('0x2c'),_0x608347('0x3'),{'type':_0x1f5ba7['STRING']}),_0x391131[_0x608347('0x7')](_0x608347('0x2c'),'IntervalId',{'type':_0x1f5ba7['INTEGER'](0xb)}),_0x391131[_0x608347('0x29')](_0x608347('0x8')),_0x391131[_0x608347('0x7')](_0x608347('0xb'),'transfer',{'type':_0x1f5ba7[_0x608347('0x21')],'defaultValue':![]}),_0x391131[_0x608347('0x7')](_0x608347('0xb'),'transfertype',{'type':_0x1f5ba7[_0x608347('0x10')],'comment':_0x608347('0x2b')}),_0x391131[_0x608347('0x7')](_0x608347('0xb'),'transferexten',{'type':_0x1f5ba7['STRING']}),_0x391131[_0x608347('0x7')](_0x608347('0xb'),_0x608347('0x6'),{'type':_0x1f5ba7[_0x608347('0x10')]}),_0x391131[_0x608347('0x7')]('report_jscripty_answers','questionId',{'type':_0x1f5ba7[_0x608347('0x10')]}),_0x391131[_0x608347('0x7')]('report_jscripty_questions',_0x608347('0x2f'),{'type':_0x1f5ba7['STRING']}),_0x391131['addColumn']('users',_0x608347('0x4'),{'type':_0x1f5ba7[_0x608347('0x21')],'defaultValue':!![]}),_0x391131[_0x608347('0x29')](_0x608347('0x14')),_0x391131['query'](_0x608347('0x1a')),_0x391131['query']('INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-preview\x27,\x20\x273\x27,\x20\x27set\x27,\x20\x27CALLERID(all)=${XMD-CALLERID}\x27,\x20\x27system\x27,\x20\x27Dialer\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());'),_0x391131[_0x608347('0x29')](_0x608347('0x28')),_0x391131[_0x608347('0x29')](_0x608347('0x25')),_0x391131[_0x608347('0x11')](_0x44df5f);});},'down':function(){}};