2cda42d47141e2ef9be00f3654c4b0bcac7194a3
[motion-next.git] / server / migrations / 2.4.0.js
1 const a991_0x489f=['indicesType','../config/logger','indexName','then','fti_chat_messages','phoneBarEnableScreenRecordingByAgent','info','body','util','inspect','queryInterface','Removed\x20column\x20%s\x20from\x20%s','addColumn','BOOLEAN','chat_messages','phoneBarEnableAutomaticScreenRecording','addIndex','finally','mail_interactions','fti_mail_messages','subject','dropTable','ALTER\x20TABLE\x20fax_applications\x20CONVERT\x20TO\x20CHARACTER\x20SET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','screenrecording','tail','removeColumn','prototype','tiny','changeColumn','ALTER\x20TABLE\x20sms_applications\x20CONVERT\x20TO\x20CHARACTER\x20SET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','openchannel_messages','table\x20dropped\x20%s','sequence','Added\x20column\x20%s\x20to\x20%s','Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s','exports','mail_messages','phoneBarEnableVideoRecording','users','FULLTEXT','removeIndex\x20%s\x20%s','renameColumn','catch','stringify','query','removeIndex','fti_openchannel_messages','sms_messages','final','join','enqueue','medium','TEXT','ALTER\x20TABLE\x20openchannel_applications\x20CONVERT\x20TO\x20CHARACTER\x20SET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'];(function(_0x432965,_0x489fb8){const _0x389051=function(_0x5009c6){while(--_0x5009c6){_0x432965['push'](_0x432965['shift']());}};_0x389051(++_0x489fb8);}(a991_0x489f,0xaa));const a991_0x3890=function(_0x432965,_0x489fb8){_0x432965=_0x432965-0x0;let _0x389051=a991_0x489f[_0x432965];return _0x389051;};const _0x5297e5=a991_0x3890;'use strict';const util=require(_0x5297e5('0x0')),logger=require(_0x5297e5('0x2f'))('migration'),Sequence=function(){};Sequence[_0x5297e5('0x12')][_0x5297e5('0x2a')]=function(_0x5009c6){const _0x7eef3d=_0x5297e5;this[_0x7eef3d('0x10')]=this[_0x7eef3d('0x10')]?this[_0x7eef3d('0x10')][_0x7eef3d('0x9')](_0x5009c6):_0x5009c6();};const Migration=function(_0x3ecc6a){const _0x5357e4=_0x5297e5;this['queryInterface']=_0x3ecc6a,this[_0x5357e4('0x18')]=new Sequence();};Migration[_0x5297e5('0x12')][_0x5297e5('0x14')]=function(_0xccd299,_0x2286e0,_0x62c9fb){const _0x430e7f=_0x5297e5,_0x26e737=this;this[_0x430e7f('0x18')][_0x430e7f('0x2a')](function(){const _0x360b75=_0x430e7f;return _0x26e737[_0x360b75('0x2')][_0x360b75('0x14')](_0xccd299,_0x2286e0,_0x62c9fb)[_0x360b75('0x31')](function(){logger['info']('Changed\x20column\x20%s\x20in\x20table\x20%s',_0x2286e0,_0xccd299);})['catch'](function(_0x3eabaa){const _0x3bf63f=_0x360b75;logger[_0x3bf63f('0x34')](JSON['stringify'](_0x3eabaa));});});},Migration[_0x5297e5('0x12')]['addColumn']=function(_0x352682,_0x562377,_0x5210c5){const _0x131a29=this;this['sequence']['enqueue'](function(){const _0x1e00d7=a991_0x3890;return _0x131a29[_0x1e00d7('0x2')][_0x1e00d7('0x4')](_0x352682,_0x562377,_0x5210c5)['then'](function(){const _0x4e7e86=_0x1e00d7;logger[_0x4e7e86('0x34')](_0x4e7e86('0x19'),_0x562377,_0x352682);})[_0x1e00d7('0x22')](function(_0x144d75){const _0x3f4f1d=_0x1e00d7;logger[_0x3f4f1d('0x34')](JSON[_0x3f4f1d('0x23')](_0x144d75));});});},Migration['prototype'][_0x5297e5('0xd')]=function(_0x3d5fc8){const _0x2b7390=_0x5297e5,_0x55813a=this;this[_0x2b7390('0x18')][_0x2b7390('0x2a')](function(){const _0x55cf37=_0x2b7390;return _0x55813a[_0x55cf37('0x2')]['dropTable'](_0x3d5fc8,{'force':!![]})[_0x55cf37('0x31')](function(){const _0xd25d3c=_0x55cf37;logger['info'](_0xd25d3c('0x17'),_0x3d5fc8);})[_0x55cf37('0x22')](function(_0x170651){const _0x42a855=_0x55cf37;logger[_0x42a855('0x34')](JSON['stringify'](_0x170651));});});},Migration[_0x5297e5('0x12')]['addIndex']=function(_0xeca06d,_0x3cff72,_0x2d5ae8){const _0x21d70c=_0x5297e5,_0xaa6456=this;this['sequence'][_0x21d70c('0x2a')](function(){const _0x4f7f4c=_0x21d70c;return _0xaa6456[_0x4f7f4c('0x2')][_0x4f7f4c('0x8')](_0xeca06d,_0x3cff72,{'indexName':_0x2d5ae8[_0x4f7f4c('0x30')],'indicesType':_0x2d5ae8['indicesType']})[_0x4f7f4c('0x31')](function(){const _0x481443=_0x4f7f4c;logger[_0x481443('0x34')]('addIndex\x20%s\x20%s\x20%s\x20[%s]',_0xeca06d,_0x3cff72[_0x481443('0x29')](','),_0x2d5ae8[_0x481443('0x30')],_0x2d5ae8[_0x481443('0x2e')]);})[_0x4f7f4c('0x22')](function(_0x317064){logger['info'](JSON['stringify'](_0x317064));});});},Migration['prototype'][_0x5297e5('0x25')]=function(_0x12cf9c,_0x58ffc4){const _0xbffa51=this;this['sequence']['enqueue'](function(){const _0x46a1c6=a991_0x3890;return _0xbffa51[_0x46a1c6('0x2')][_0x46a1c6('0x25')](_0x12cf9c,_0x58ffc4)[_0x46a1c6('0x31')](function(){const _0x8775d2=_0x46a1c6;logger['info'](_0x8775d2('0x20'),_0x12cf9c,_0x58ffc4);})[_0x46a1c6('0x22')](function(_0x358dcb){const _0x1b630b=_0x46a1c6;logger[_0x1b630b('0x34')](JSON[_0x1b630b('0x23')](_0x358dcb));});});},Migration[_0x5297e5('0x12')]['query']=function(_0x4b5a2a){const _0x184a0a=_0x5297e5,_0xcabadb=this;this[_0x184a0a('0x18')][_0x184a0a('0x2a')](function(){const _0x4fcc60=_0x184a0a;return _0xcabadb[_0x4fcc60('0x2')]['sequelize'][_0x4fcc60('0x24')](_0x4b5a2a)[_0x4fcc60('0x31')](function(){const _0x1f98f2=_0x4fcc60;logger[_0x1f98f2('0x34')]('query\x20%s',_0x4b5a2a);})[_0x4fcc60('0x22')](function(_0x2b547f){const _0x2389ea=_0x4fcc60;logger[_0x2389ea('0x34')](JSON['stringify'](_0x2b547f));});});},Migration[_0x5297e5('0x12')][_0x5297e5('0x11')]=function(_0x4228a0,_0x3b66ec){const _0x2f7194=_0x5297e5,_0x4c152a=this;this[_0x2f7194('0x18')][_0x2f7194('0x2a')](function(){const _0x481ad8=_0x2f7194;return _0x4c152a['queryInterface'][_0x481ad8('0x11')](_0x4228a0,_0x3b66ec)[_0x481ad8('0x31')](function(){const _0x23cd03=_0x481ad8;logger[_0x23cd03('0x34')](_0x23cd03('0x3'),_0x3b66ec,_0x4228a0);})['catch'](function(_0xf5796f){const _0x394680=_0x481ad8;logger['info'](util[_0x394680('0x1')](_0xf5796f,{'showHidden':![],'depth':null}));});});},Migration[_0x5297e5('0x12')][_0x5297e5('0x21')]=function(_0x3b0bde,_0x124355,_0x43a2e6){const _0x2ad059=_0x5297e5,_0x4e3883=this;this[_0x2ad059('0x18')]['enqueue'](function(){const _0x362926=_0x2ad059;return _0x4e3883[_0x362926('0x2')][_0x362926('0x21')](_0x3b0bde,_0x124355,_0x43a2e6)[_0x362926('0x31')](function(){const _0xd91eec=_0x362926;logger[_0xd91eec('0x34')](_0xd91eec('0x1a'),_0x124355,_0x43a2e6,_0x3b0bde);})[_0x362926('0x22')](function(_0x46ffe4){const _0x4735e7=_0x362926;logger['info'](util[_0x4735e7('0x1')](_0x46ffe4,{'showHidden':![],'depth':null}));});});},Migration['prototype'][_0x5297e5('0x28')]=function(_0x5483e){const _0x4998c7=_0x5297e5;this[_0x4998c7('0x18')]['enqueue'](function(){return _0x5483e();});},module[_0x5297e5('0x1b')]={'up':function(_0x287bc9,_0x264e86){return new Promise(function(_0x4c063d){const _0x485e25=a991_0x3890,_0x42dadf=new Migration(_0x287bc9);_0x42dadf['renameColumn'](_0x485e25('0x1e'),_0x485e25('0x1d'),_0x485e25('0x33')),_0x42dadf[_0x485e25('0x4')]('users',_0x485e25('0x7'),{'type':_0x264e86[_0x485e25('0x5')],'defaultValue':![]}),_0x42dadf[_0x485e25('0x4')](_0x485e25('0x1e'),_0x485e25('0xf'),{'type':_0x264e86[_0x485e25('0x5')],'defaultValue':![]}),_0x42dadf[_0x485e25('0x8')](_0x485e25('0x6'),[_0x485e25('0x35')],{'indexName':_0x485e25('0x32'),'indicesType':_0x485e25('0x1f')}),_0x42dadf['addIndex']('mail_interactions',[_0x485e25('0xc'),'to'],{'indexName':'fti_mail_interactions','indicesType':_0x485e25('0x1f')}),_0x42dadf[_0x485e25('0x4')](_0x485e25('0xa'),'lastMsgText',{'type':_0x264e86[_0x485e25('0x2c')](_0x485e25('0x13')),'after':'lastMsgBody'}),_0x42dadf[_0x485e25('0x4')](_0x485e25('0x1c'),'plainBody',{'type':_0x264e86[_0x485e25('0x2c')](_0x485e25('0x2b')),'after':_0x485e25('0x35')}),_0x42dadf[_0x485e25('0x8')]('mail_messages',['plainBody','subject'],{'indexName':_0x485e25('0xb'),'indicesType':_0x485e25('0x1f')}),_0x42dadf['addIndex'](_0x485e25('0x16'),[_0x485e25('0x35')],{'indexName':_0x485e25('0x26'),'indicesType':_0x485e25('0x1f')}),_0x42dadf['addIndex'](_0x485e25('0x27'),['body'],{'indexName':'fti_sms_messages','indicesType':_0x485e25('0x1f')}),_0x42dadf[_0x485e25('0x24')]('ALTER\x20TABLE\x20chat_applications\x20CONVERT\x20TO\x20CHARACTER\x20SET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'),_0x42dadf[_0x485e25('0x24')](_0x485e25('0xe')),_0x42dadf[_0x485e25('0x24')]('ALTER\x20TABLE\x20mail_applications\x20CONVERT\x20TO\x20CHARACTER\x20SET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'),_0x42dadf[_0x485e25('0x24')](_0x485e25('0x2d')),_0x42dadf['query'](_0x485e25('0x15')),_0x42dadf[_0x485e25('0x28')](_0x4c063d);});},'down':function(){}};