Built motion from commit f651e4b0a7312c0adceb5e57d6684a801a3aaf0d. Version 3.0.0...
[motion-next.git] / server / migrations / 2.0.38.js
1 const a917_0x3b89=['t38pt_udptl','Ls\x20:','Changed\x20column\x20%s\x20in\x20table\x20%s','migration','STRING','util','remote','then','table\x20dropped\x20%s','messageId','queryInterface','INTEGER','dropTable','sms_messages','sequence','\x20Error\x20:','addIndex','stringify','changeColumn','token','removeColumn','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','info','exec','tail','finally','chown\x20motion:asterisk\x20/var/opt/motion2/server/files/attachments','enqueue','prototype','../config/logger','tools_trunks','addColumn','query','sms_accounts','sequelize','fax_messages','query\x20%s','AttachmentId','catch','Exec\x20chmod','Added\x20column\x20%s\x20to\x20%s','addIndex\x20%s\x20%s\x20%s','final'];(function(_0x1fe41c,_0x3b892d){const _0x3e9922=function(_0x385046){while(--_0x385046){_0x1fe41c['push'](_0x1fe41c['shift']());}};_0x3e9922(++_0x3b892d);}(a917_0x3b89,0x1a9));const a917_0x3e99=function(_0x1fe41c,_0x3b892d){_0x1fe41c=_0x1fe41c-0x0;let _0x3e9922=a917_0x3b89[_0x1fe41c];return _0x3e9922;};const _0x38c476=a917_0x3e99;'use strict';const logger=require(_0x38c476('0x22'))(_0x38c476('0x8')),util=require(_0x38c476('0xa')),exec=require('child_process')[_0x38c476('0x1c')],cmd=_0x38c476('0x1f'),ls='ls\x20-la\x20/var/opt/motion2/server/files',Sequence=function(){};Sequence[_0x38c476('0x21')][_0x38c476('0x20')]=function(_0x385046){const _0x5890b0=_0x38c476;this[_0x5890b0('0x1d')]=this[_0x5890b0('0x1d')]?this[_0x5890b0('0x1d')][_0x5890b0('0x1e')](_0x385046):_0x385046();};const Migration=function(_0xbf7c62){const _0x224193=_0x38c476;this[_0x224193('0xf')]=_0xbf7c62,this[_0x224193('0x13')]=new Sequence();};Migration['prototype'][_0x38c476('0x17')]=function(_0x3c0be6,_0x5bec80,_0x45674c){const _0x4975c1=_0x38c476,_0x233ba0=this;this[_0x4975c1('0x13')][_0x4975c1('0x20')](function(){const _0x1a0f8c=_0x4975c1;return _0x233ba0[_0x1a0f8c('0xf')][_0x1a0f8c('0x17')](_0x3c0be6,_0x5bec80,_0x45674c)[_0x1a0f8c('0xc')](function(){const _0x57308f=_0x1a0f8c;logger[_0x57308f('0x1b')](_0x57308f('0x7'),_0x5bec80,_0x3c0be6);})[_0x1a0f8c('0x0')](function(_0x32bbb2){const _0x280c4c=_0x1a0f8c;logger[_0x280c4c('0x1b')](JSON[_0x280c4c('0x16')](_0x32bbb2));});});},Migration['prototype']['addColumn']=function(_0x2246e4,_0xed8df3,_0x120285){const _0x4d59cd=_0x38c476,_0x160ed0=this;this[_0x4d59cd('0x13')]['enqueue'](function(){const _0x3a9504=_0x4d59cd;return _0x160ed0[_0x3a9504('0xf')][_0x3a9504('0x24')](_0x2246e4,_0xed8df3,_0x120285)['then'](function(){const _0x20954e=_0x3a9504;logger[_0x20954e('0x1b')](_0x20954e('0x2'),_0xed8df3,_0x2246e4);})[_0x3a9504('0x0')](function(_0x518a43){const _0x4ff638=_0x3a9504;logger[_0x4ff638('0x1b')](JSON[_0x4ff638('0x16')](_0x518a43));});});},Migration[_0x38c476('0x21')]['dropTable']=function(_0x54b1eb){const _0x5652bd=this;this['sequence']['enqueue'](function(){const _0x23071b=a917_0x3e99;return _0x5652bd[_0x23071b('0xf')][_0x23071b('0x11')](_0x54b1eb,{'force':!![]})[_0x23071b('0xc')](function(){const _0x34ecdc=_0x23071b;logger[_0x34ecdc('0x1b')](_0x34ecdc('0xd'),_0x54b1eb);})[_0x23071b('0x0')](function(_0x2959ab){const _0x1a4287=_0x23071b;logger['info'](JSON[_0x1a4287('0x16')](_0x2959ab));});});},Migration['prototype'][_0x38c476('0x15')]=function(_0x8af92b,_0x512c22,_0x1dc7c8){const _0x1b47e8=_0x38c476,_0x3597ac=this;this['sequence'][_0x1b47e8('0x20')](function(){const _0xcf3eeb=_0x1b47e8;return _0x3597ac['queryInterface'][_0xcf3eeb('0x15')](_0x8af92b,_0x512c22,{'indexName':_0x1dc7c8})[_0xcf3eeb('0xc')](function(){const _0x4312ab=_0xcf3eeb;logger[_0x4312ab('0x1b')](_0x4312ab('0x3'),_0x8af92b,_0x512c22['join'](','),_0x1dc7c8);})[_0xcf3eeb('0x0')](function(_0x583fb4){const _0x2f284c=_0xcf3eeb;logger['info'](JSON[_0x2f284c('0x16')](_0x583fb4));});});},Migration[_0x38c476('0x21')][_0x38c476('0x25')]=function(_0x469223){const _0x5d072e=this;this['sequence']['enqueue'](function(){const _0x59a23c=a917_0x3e99;return _0x5d072e[_0x59a23c('0xf')][_0x59a23c('0x27')][_0x59a23c('0x25')](_0x469223)['then'](function(){const _0xaf5429=_0x59a23c;logger[_0xaf5429('0x1b')](_0xaf5429('0x29'),_0x469223);})[_0x59a23c('0x0')](function(_0x11d00c){logger['info'](JSON['stringify'](_0x11d00c));});});},Migration['prototype'][_0x38c476('0x19')]=function(_0x3fde76,_0x285c5b){const _0x962fc2=_0x38c476,_0x3725db=this;this[_0x962fc2('0x13')]['enqueue'](function(){const _0x1fc73f=_0x962fc2;return _0x3725db[_0x1fc73f('0xf')][_0x1fc73f('0x19')](_0x3fde76,_0x285c5b)['then'](function(){const _0x936064=_0x1fc73f;logger[_0x936064('0x1b')]('Removed\x20column\x20%s\x20from\x20%s',_0x285c5b,_0x3fde76);})[_0x1fc73f('0x0')](function(_0x2b71ec){const _0x495d32=_0x1fc73f;logger[_0x495d32('0x1b')](util['inspect'](_0x2b71ec,{'showHidden':![],'depth':null}));});});},Migration['prototype'][_0x38c476('0x4')]=function(_0x351ea8){const _0x237f8d=_0x38c476;this[_0x237f8d('0x13')]['enqueue'](function(){return _0x351ea8();});},module['exports']={'up':function(_0x23a8ec,_0x3177f9){return new Promise(function(_0x546931){const _0x5757f7=a917_0x3e99,_0x459081=new Migration(_0x23a8ec);_0x459081['addColumn'](_0x5757f7('0x26'),_0x5757f7('0xb'),{'type':_0x3177f9['STRING']}),_0x459081['addColumn'](_0x5757f7('0x26'),_0x5757f7('0x18'),{'type':_0x3177f9['STRING']}),_0x459081[_0x5757f7('0x24')](_0x5757f7('0x12'),_0x5757f7('0xe'),{'type':_0x3177f9[_0x5757f7('0x9')]}),exec(cmd,function(_0x501fcf,_0x250c46,_0x1e32bc){const _0x522a0e=_0x5757f7;logger['info'](_0x522a0e('0x1'),'\x20Error\x20:',JSON[_0x522a0e('0x16')](_0x501fcf),_0x250c46,_0x1e32bc),exec(ls,function(_0x29b041,_0x5e19cc,_0x5132cc){const _0x58fa27=_0x522a0e;logger[_0x58fa27('0x1b')](_0x58fa27('0x6'),_0x58fa27('0x14'),JSON[_0x58fa27('0x16')](_0x29b041),_0x5e19cc,_0x5132cc);});}),_0x459081[_0x5757f7('0x11')]('fax_applications'),_0x459081[_0x5757f7('0x24')](_0x5757f7('0x28'),_0x5757f7('0x2a'),{'type':_0x3177f9[_0x5757f7('0x10')]}),_0x459081[_0x5757f7('0x25')](_0x5757f7('0x1a')),_0x459081[_0x5757f7('0x24')](_0x5757f7('0x23'),_0x5757f7('0x5'),{'type':_0x3177f9[_0x5757f7('0x9')],'defaultValue':'no'}),_0x459081[_0x5757f7('0x4')](_0x546931);});},'down':function(){}};