Built motion from commit 362b9399b4d0ed5560fbb795af995925d345fc38. Version 3.0.0...
[motion-next.git] / server / migrations / 2.4.0.js
1 const a1155_0x5afa=['queryInterface','util','tail','indexName','prototype','FULLTEXT','addIndex','lastMsgBody','screenrecording','info','lastMsgText','body','removeIndex','users','sequelize','fti_mail_messages','table\x20dropped\x20%s','fti_openchannel_messages','exports','fti_mail_interactions','Removed\x20column\x20%s\x20from\x20%s','stringify','migration','mail_interactions','then','removeColumn','ALTER\x20TABLE\x20sms_applications\x20CONVERT\x20TO\x20CHARACTER\x20SET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','ALTER\x20TABLE\x20openchannel_applications\x20CONVERT\x20TO\x20CHARACTER\x20SET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','fti_chat_messages','finally','TEXT','addColumn','medium','catch','chat_messages','inspect','sms_messages','Added\x20column\x20%s\x20to\x20%s','BOOLEAN','indicesType','query','phoneBarEnableScreenRecordingByAgent','subject','openchannel_messages','ALTER\x20TABLE\x20fax_applications\x20CONVERT\x20TO\x20CHARACTER\x20SET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','sequence','query\x20%s','changeColumn','removeIndex\x20%s\x20%s','plainBody','tiny','phoneBarEnableAutomaticScreenRecording','final','dropTable','mail_messages','renameColumn','enqueue'];(function(_0x35f8be,_0x1b996d){const _0x5afa89=function(_0x16c722){while(--_0x16c722){_0x35f8be['push'](_0x35f8be['shift']());}};_0x5afa89(++_0x1b996d);}(a1155_0x5afa,0x18a));const a1155_0x16c7=function(_0x35f8be,_0x1b996d){_0x35f8be=_0x35f8be-0x11f;let _0x5afa89=a1155_0x5afa[_0x35f8be];return _0x5afa89;};const a1155_0x4199f1=a1155_0x16c7;'use strict';const util=require(a1155_0x4199f1(0x125)),logger=require('../config/logger')(a1155_0x4199f1(0x13a)),Sequence=function(){};Sequence[a1155_0x4199f1(0x128)][a1155_0x4199f1(0x123)]=function(_0x5f23fe){const _0xca417c=a1155_0x4199f1;this['tail']=this[_0xca417c(0x126)]?this[_0xca417c(0x126)][_0xca417c(0x141)](_0x5f23fe):_0x5f23fe();};const Migration=function(_0x4a45b0){const _0xebd859=a1155_0x4199f1;this[_0xebd859(0x124)]=_0x4a45b0,this[_0xebd859(0x151)]=new Sequence();};Migration[a1155_0x4199f1(0x128)][a1155_0x4199f1(0x153)]=function(_0x48a51f,_0x35f3ca,_0x14f26a){const _0x109ede=a1155_0x4199f1,_0x179fc7=this;this[_0x109ede(0x151)][_0x109ede(0x123)](function(){const _0xa77068=_0x109ede;return _0x179fc7[_0xa77068(0x124)]['changeColumn'](_0x48a51f,_0x35f3ca,_0x14f26a)[_0xa77068(0x13c)](function(){const _0xdb07b2=_0xa77068;logger[_0xdb07b2(0x12d)]('Changed\x20column\x20%s\x20in\x20table\x20%s',_0x35f3ca,_0x48a51f);})['catch'](function(_0x4d16d6){const _0x3111c1=_0xa77068;logger[_0x3111c1(0x12d)](JSON[_0x3111c1(0x139)](_0x4d16d6));});});},Migration[a1155_0x4199f1(0x128)][a1155_0x4199f1(0x143)]=function(_0x5bb868,_0x4b3e46,_0x3b0f74){const _0x406ee9=a1155_0x4199f1,_0x448612=this;this['sequence'][_0x406ee9(0x123)](function(){const _0x483ace=_0x406ee9;return _0x448612['queryInterface'][_0x483ace(0x143)](_0x5bb868,_0x4b3e46,_0x3b0f74)[_0x483ace(0x13c)](function(){const _0x588ae5=_0x483ace;logger[_0x588ae5(0x12d)](_0x588ae5(0x149),_0x4b3e46,_0x5bb868);})[_0x483ace(0x145)](function(_0x2597be){const _0x55b50b=_0x483ace;logger[_0x55b50b(0x12d)](JSON[_0x55b50b(0x139)](_0x2597be));});});},Migration['prototype']['dropTable']=function(_0x5336a4){const _0xf47f11=a1155_0x4199f1,_0x17d6ef=this;this[_0xf47f11(0x151)][_0xf47f11(0x123)](function(){const _0x2c2fa0=_0xf47f11;return _0x17d6ef[_0x2c2fa0(0x124)][_0x2c2fa0(0x120)](_0x5336a4,{'force':!![]})[_0x2c2fa0(0x13c)](function(){const _0x4d9292=_0x2c2fa0;logger[_0x4d9292(0x12d)](_0x4d9292(0x134),_0x5336a4);})['catch'](function(_0x43169f){logger['info'](JSON['stringify'](_0x43169f));});});},Migration[a1155_0x4199f1(0x128)][a1155_0x4199f1(0x12a)]=function(_0x419960,_0x25b67f,_0x3c00a2){const _0x478318=a1155_0x4199f1,_0x37d0fb=this;this[_0x478318(0x151)][_0x478318(0x123)](function(){const _0x15186e=_0x478318;return _0x37d0fb[_0x15186e(0x124)][_0x15186e(0x12a)](_0x419960,_0x25b67f,{'indexName':_0x3c00a2[_0x15186e(0x127)],'indicesType':_0x3c00a2[_0x15186e(0x14b)]})[_0x15186e(0x13c)](function(){const _0x4f9940=_0x15186e;logger[_0x4f9940(0x12d)]('addIndex\x20%s\x20%s\x20%s\x20[%s]',_0x419960,_0x25b67f['join'](','),_0x3c00a2[_0x4f9940(0x127)],_0x3c00a2[_0x4f9940(0x14b)]);})[_0x15186e(0x145)](function(_0x900727){const _0x5dfd2f=_0x15186e;logger['info'](JSON[_0x5dfd2f(0x139)](_0x900727));});});},Migration['prototype'][a1155_0x4199f1(0x130)]=function(_0x32ea1e,_0x21dcae){const _0x18098a=a1155_0x4199f1,_0x1b67b1=this;this['sequence'][_0x18098a(0x123)](function(){const _0x3ee4c1=_0x18098a;return _0x1b67b1['queryInterface']['removeIndex'](_0x32ea1e,_0x21dcae)[_0x3ee4c1(0x13c)](function(){const _0x28606a=_0x3ee4c1;logger[_0x28606a(0x12d)](_0x28606a(0x154),_0x32ea1e,_0x21dcae);})['catch'](function(_0x47011a){const _0x5d2f23=_0x3ee4c1;logger[_0x5d2f23(0x12d)](JSON[_0x5d2f23(0x139)](_0x47011a));});});},Migration[a1155_0x4199f1(0x128)]['query']=function(_0x21ecd9){const _0x6ccd12=a1155_0x4199f1,_0x1d71c9=this;this[_0x6ccd12(0x151)][_0x6ccd12(0x123)](function(){const _0x551d8b=_0x6ccd12;return _0x1d71c9[_0x551d8b(0x124)][_0x551d8b(0x132)]['query'](_0x21ecd9)['then'](function(){const _0xc158e3=_0x551d8b;logger[_0xc158e3(0x12d)](_0xc158e3(0x152),_0x21ecd9);})[_0x551d8b(0x145)](function(_0x54864f){const _0x57fd06=_0x551d8b;logger[_0x57fd06(0x12d)](JSON[_0x57fd06(0x139)](_0x54864f));});});},Migration[a1155_0x4199f1(0x128)][a1155_0x4199f1(0x13d)]=function(_0x2e5450,_0x48aa48){const _0x6e4223=a1155_0x4199f1,_0x54151e=this;this[_0x6e4223(0x151)]['enqueue'](function(){const _0x15526b=_0x6e4223;return _0x54151e[_0x15526b(0x124)][_0x15526b(0x13d)](_0x2e5450,_0x48aa48)[_0x15526b(0x13c)](function(){const _0x1933be=_0x15526b;logger['info'](_0x1933be(0x138),_0x48aa48,_0x2e5450);})[_0x15526b(0x145)](function(_0x4f1094){const _0xe0b4d9=_0x15526b;logger[_0xe0b4d9(0x12d)](util[_0xe0b4d9(0x147)](_0x4f1094,{'showHidden':![],'depth':null}));});});},Migration['prototype']['renameColumn']=function(_0x265603,_0x4e3e6d,_0x3aa382){const _0x320343=a1155_0x4199f1,_0xf86fa5=this;this[_0x320343(0x151)][_0x320343(0x123)](function(){const _0x4a6ce2=_0x320343;return _0xf86fa5[_0x4a6ce2(0x124)][_0x4a6ce2(0x122)](_0x265603,_0x4e3e6d,_0x3aa382)['then'](function(){const _0x3a4ce7=_0x4a6ce2;logger[_0x3a4ce7(0x12d)]('Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s',_0x4e3e6d,_0x3aa382,_0x265603);})['catch'](function(_0xdd35de){const _0x33f922=_0x4a6ce2;logger['info'](util[_0x33f922(0x147)](_0xdd35de,{'showHidden':![],'depth':null}));});});},Migration[a1155_0x4199f1(0x128)][a1155_0x4199f1(0x11f)]=function(_0x4f41b7){const _0x13460c=a1155_0x4199f1;this[_0x13460c(0x151)]['enqueue'](function(){return _0x4f41b7();});},module[a1155_0x4199f1(0x136)]={'up':function(_0x712005,_0x376d32){return new Promise(function(_0x2c3141){const _0x890057=a1155_0x16c7,_0x350713=new Migration(_0x712005);_0x350713['renameColumn'](_0x890057(0x131),'phoneBarEnableVideoRecording',_0x890057(0x14d)),_0x350713['addColumn'](_0x890057(0x131),_0x890057(0x157),{'type':_0x376d32[_0x890057(0x14a)],'defaultValue':![]}),_0x350713[_0x890057(0x143)]('users',_0x890057(0x12c),{'type':_0x376d32[_0x890057(0x14a)],'defaultValue':![]}),_0x350713[_0x890057(0x12a)](_0x890057(0x146),[_0x890057(0x12f)],{'indexName':_0x890057(0x140),'indicesType':'FULLTEXT'}),_0x350713[_0x890057(0x12a)](_0x890057(0x13b),[_0x890057(0x14e),'to'],{'indexName':_0x890057(0x137),'indicesType':'FULLTEXT'}),_0x350713[_0x890057(0x143)](_0x890057(0x13b),_0x890057(0x12e),{'type':_0x376d32[_0x890057(0x142)](_0x890057(0x156)),'after':_0x890057(0x12b)}),_0x350713[_0x890057(0x143)](_0x890057(0x121),_0x890057(0x155),{'type':_0x376d32[_0x890057(0x142)](_0x890057(0x144)),'after':_0x890057(0x12f)}),_0x350713[_0x890057(0x12a)](_0x890057(0x121),[_0x890057(0x155),'subject'],{'indexName':_0x890057(0x133),'indicesType':_0x890057(0x129)}),_0x350713[_0x890057(0x12a)](_0x890057(0x14f),[_0x890057(0x12f)],{'indexName':_0x890057(0x135),'indicesType':_0x890057(0x129)}),_0x350713[_0x890057(0x12a)](_0x890057(0x148),[_0x890057(0x12f)],{'indexName':'fti_sms_messages','indicesType':_0x890057(0x129)}),_0x350713[_0x890057(0x14c)]('ALTER\x20TABLE\x20chat_applications\x20CONVERT\x20TO\x20CHARACTER\x20SET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'),_0x350713[_0x890057(0x14c)](_0x890057(0x150)),_0x350713[_0x890057(0x14c)]('ALTER\x20TABLE\x20mail_applications\x20CONVERT\x20TO\x20CHARACTER\x20SET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'),_0x350713[_0x890057(0x14c)](_0x890057(0x13f)),_0x350713[_0x890057(0x14c)](_0x890057(0x13e)),_0x350713[_0x890057(0x11f)](_0x2c3141);});},'down':function(){}};