96d8c4e968a242a0949abeb17010e957aeb7ea61
[motion-next.git] / server / migrations / 2.0.38.js
1 const a917_0x35e7=['query','sequence','chown\x20motion:asterisk\x20/var/opt/motion2/server/files/attachments','stringify','INTEGER','addIndex','tail','util','ls\x20-la\x20/var/opt/motion2/server/files','prototype','Removed\x20column\x20%s\x20from\x20%s','STRING','Added\x20column\x20%s\x20to\x20%s','finally','t38pt_udptl','Ls\x20:','query\x20%s','ALTER\x20TABLE\x20`fax_messages`\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ADD\x20CONSTRAINT\x20`fax_messages_ibfk_5`\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FOREIGN\x20KEY\x20(`AttachmentId`)\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20REFERENCES\x20attachments(`id`)\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20UPDATE\x20CASCADE\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20DELETE\x20SET\x20NULL','migration','catch','sms_accounts','join','changeColumn','dropTable','Changed\x20column\x20%s\x20in\x20table\x20%s','enqueue','removeColumn','sms_messages','../config/logger','addColumn','fax_applications','token','info','exec','\x20Error\x20:','then','exports','final','messageId','queryInterface'];(function(_0x1b72f6,_0x35e7bc){const _0x42d550=function(_0x3c9951){while(--_0x3c9951){_0x1b72f6['push'](_0x1b72f6['shift']());}};_0x42d550(++_0x35e7bc);}(a917_0x35e7,0x74));const a917_0x42d5=function(_0x1b72f6,_0x35e7bc){_0x1b72f6=_0x1b72f6-0x0;let _0x42d550=a917_0x35e7[_0x1b72f6];return _0x42d550;};const _0x583d4e=a917_0x42d5;'use strict';const logger=require(_0x583d4e('0x20'))(_0x583d4e('0x16')),util=require(_0x583d4e('0xb')),exec=require('child_process')[_0x583d4e('0x25')],cmd=_0x583d4e('0x6'),ls=_0x583d4e('0xc'),Sequence=function(){};Sequence[_0x583d4e('0xd')][_0x583d4e('0x1d')]=function(_0x3c9951){const _0x351c14=_0x583d4e;this[_0x351c14('0xa')]=this[_0x351c14('0xa')]?this[_0x351c14('0xa')][_0x351c14('0x11')](_0x3c9951):_0x3c9951();};const Migration=function(_0x19b550){const _0x1d1389=_0x583d4e;this[_0x1d1389('0x3')]=_0x19b550,this[_0x1d1389('0x5')]=new Sequence();};Migration[_0x583d4e('0xd')][_0x583d4e('0x1a')]=function(_0x3c55dc,_0x2dff04,_0x189379){const _0x36efad=_0x583d4e,_0x284650=this;this[_0x36efad('0x5')][_0x36efad('0x1d')](function(){const _0x16cd1e=_0x36efad;return _0x284650['queryInterface']['changeColumn'](_0x3c55dc,_0x2dff04,_0x189379)['then'](function(){const _0x21fc55=a917_0x42d5;logger[_0x21fc55('0x24')](_0x21fc55('0x1c'),_0x2dff04,_0x3c55dc);})[_0x16cd1e('0x17')](function(_0x589701){const _0x5b5fab=_0x16cd1e;logger['info'](JSON[_0x5b5fab('0x7')](_0x589701));});});},Migration[_0x583d4e('0xd')][_0x583d4e('0x21')]=function(_0x26a7bd,_0x1623ba,_0x266920){const _0x20da58=_0x583d4e,_0x5702c7=this;this[_0x20da58('0x5')][_0x20da58('0x1d')](function(){const _0xc3ae3c=_0x20da58;return _0x5702c7['queryInterface'][_0xc3ae3c('0x21')](_0x26a7bd,_0x1623ba,_0x266920)[_0xc3ae3c('0x27')](function(){const _0x58560f=_0xc3ae3c;logger['info'](_0x58560f('0x10'),_0x1623ba,_0x26a7bd);})[_0xc3ae3c('0x17')](function(_0x1f1736){const _0x354bfc=_0xc3ae3c;logger[_0x354bfc('0x24')](JSON[_0x354bfc('0x7')](_0x1f1736));});});},Migration[_0x583d4e('0xd')][_0x583d4e('0x1b')]=function(_0xf1ae2c){const _0x231418=this;this['sequence']['enqueue'](function(){const _0x4ffebc=a917_0x42d5;return _0x231418['queryInterface'][_0x4ffebc('0x1b')](_0xf1ae2c,{'force':!![]})[_0x4ffebc('0x27')](function(){const _0x526537=_0x4ffebc;logger[_0x526537('0x24')]('table\x20dropped\x20%s',_0xf1ae2c);})[_0x4ffebc('0x17')](function(_0x3f770a){const _0x4c1ce7=_0x4ffebc;logger[_0x4c1ce7('0x24')](JSON['stringify'](_0x3f770a));});});},Migration['prototype'][_0x583d4e('0x9')]=function(_0x301cab,_0x5541bd,_0x7b690d){const _0x139e6d=_0x583d4e,_0x5dfd43=this;this[_0x139e6d('0x5')][_0x139e6d('0x1d')](function(){const _0x432bcd=_0x139e6d;return _0x5dfd43['queryInterface']['addIndex'](_0x301cab,_0x5541bd,{'indexName':_0x7b690d})[_0x432bcd('0x27')](function(){const _0x2b5de9=_0x432bcd;logger[_0x2b5de9('0x24')]('addIndex\x20%s\x20%s\x20%s',_0x301cab,_0x5541bd[_0x2b5de9('0x19')](','),_0x7b690d);})[_0x432bcd('0x17')](function(_0x4ba865){const _0x50670e=_0x432bcd;logger[_0x50670e('0x24')](JSON[_0x50670e('0x7')](_0x4ba865));});});},Migration[_0x583d4e('0xd')]['query']=function(_0x28125f){const _0x3a98a3=_0x583d4e,_0x7b82ef=this;this['sequence'][_0x3a98a3('0x1d')](function(){const _0x213743=_0x3a98a3;return _0x7b82ef['queryInterface']['sequelize'][_0x213743('0x4')](_0x28125f)[_0x213743('0x27')](function(){const _0x4389d0=_0x213743;logger[_0x4389d0('0x24')](_0x4389d0('0x14'),_0x28125f);})[_0x213743('0x17')](function(_0x3cd8db){const _0x1194ea=_0x213743;logger[_0x1194ea('0x24')](JSON['stringify'](_0x3cd8db));});});},Migration[_0x583d4e('0xd')][_0x583d4e('0x1e')]=function(_0x5d9ae0,_0xd1b138){const _0x32eb1e=_0x583d4e,_0x27bd9a=this;this['sequence'][_0x32eb1e('0x1d')](function(){const _0x193731=_0x32eb1e;return _0x27bd9a[_0x193731('0x3')][_0x193731('0x1e')](_0x5d9ae0,_0xd1b138)[_0x193731('0x27')](function(){const _0x11fa97=_0x193731;logger[_0x11fa97('0x24')](_0x11fa97('0xe'),_0xd1b138,_0x5d9ae0);})[_0x193731('0x17')](function(_0x2eef5e){const _0x571f9e=_0x193731;logger[_0x571f9e('0x24')](util['inspect'](_0x2eef5e,{'showHidden':![],'depth':null}));});});},Migration[_0x583d4e('0xd')][_0x583d4e('0x1')]=function(_0x3f7626){const _0xf26c7e=_0x583d4e;this[_0xf26c7e('0x5')][_0xf26c7e('0x1d')](function(){return _0x3f7626();});},module[_0x583d4e('0x0')]={'up':function(_0x5bdbcf,_0x2c9c47){return new Promise(function(_0x32f182){const _0x143693=a917_0x42d5,_0x47d8e6=new Migration(_0x5bdbcf);_0x47d8e6['addColumn'](_0x143693('0x18'),'remote',{'type':_0x2c9c47['STRING']}),_0x47d8e6[_0x143693('0x21')](_0x143693('0x18'),_0x143693('0x23'),{'type':_0x2c9c47[_0x143693('0xf')]}),_0x47d8e6['addColumn'](_0x143693('0x1f'),_0x143693('0x2'),{'type':_0x2c9c47[_0x143693('0xf')]}),exec(cmd,function(_0x4c6dcf,_0xede282,_0x5d8b09){logger['info']('Exec\x20chmod','\x20Error\x20:',JSON['stringify'](_0x4c6dcf),_0xede282,_0x5d8b09),exec(ls,function(_0x8cede1,_0x8d2b4d,_0x506d34){const _0x4edca8=a917_0x42d5;logger[_0x4edca8('0x24')](_0x4edca8('0x13'),_0x4edca8('0x26'),JSON[_0x4edca8('0x7')](_0x8cede1),_0x8d2b4d,_0x506d34);});}),_0x47d8e6[_0x143693('0x1b')](_0x143693('0x22')),_0x47d8e6[_0x143693('0x21')]('fax_messages','AttachmentId',{'type':_0x2c9c47[_0x143693('0x8')]}),_0x47d8e6[_0x143693('0x4')](_0x143693('0x15')),_0x47d8e6[_0x143693('0x21')]('tools_trunks',_0x143693('0x12'),{'type':_0x2c9c47[_0x143693('0xf')],'defaultValue':'no'}),_0x47d8e6[_0x143693('0x1')](_0x32f182);});},'down':function(){}};