Built motion from commit 129fb4d95212661e48f0db455e75d668addbaddf. Version 3.0.0...
[motion-next.git] / server / migrations / 2.0.38.js
index ee57067..380ce5a 100644 (file)
@@ -1 +1 @@
-const a916_0x31e8=['join','sequence','dropTable','Added\x20column\x20%s\x20to\x20%s','final','\x20Error\x20:','prototype','info','finally','query','AttachmentId','util','messageId','tools_trunks','then','Ls\x20:','addIndex\x20%s\x20%s\x20%s','sms_messages','fax_applications','remote','addIndex','enqueue','removeColumn','sms_accounts','chown\x20motion:asterisk\x20/var/opt/motion2/server/files/attachments','tail','STRING','changeColumn','fax_messages','stringify','INTEGER','migration','child_process','catch','addColumn','exports','t38pt_udptl','query\x20%s','queryInterface','token','Changed\x20column\x20%s\x20in\x20table\x20%s','../config/logger'];(function(_0x5b042a,_0x31e8ba){const _0xa2d64c=function(_0x4e792b){while(--_0x4e792b){_0x5b042a['push'](_0x5b042a['shift']());}};_0xa2d64c(++_0x31e8ba);}(a916_0x31e8,0x79));const a916_0xa2d6=function(_0x5b042a,_0x31e8ba){_0x5b042a=_0x5b042a-0x0;let _0xa2d64c=a916_0x31e8[_0x5b042a];return _0xa2d64c;};const _0x4f5e86=a916_0xa2d6;'use strict';const logger=require(_0x4f5e86('0x4'))(_0x4f5e86('0x24')),util=require(_0x4f5e86('0x10')),exec=require(_0x4f5e86('0x25'))['exec'],cmd=_0x4f5e86('0x1d'),ls='ls\x20-la\x20/var/opt/motion2/server/files',Sequence=function(){};Sequence[_0x4f5e86('0xb')]['enqueue']=function(_0x4e792b){const _0x356601=_0x4f5e86;this['tail']=this['tail']?this[_0x356601('0x1e')][_0x356601('0xd')](_0x4e792b):_0x4e792b();};const Migration=function(_0x2ff309){const _0xbcc8d=_0x4f5e86;this[_0xbcc8d('0x1')]=_0x2ff309,this[_0xbcc8d('0x6')]=new Sequence();};Migration[_0x4f5e86('0xb')][_0x4f5e86('0x20')]=function(_0x55cba1,_0x697ea0,_0x7573d0){const _0x5f1b9e=_0x4f5e86,_0x488984=this;this[_0x5f1b9e('0x6')][_0x5f1b9e('0x1a')](function(){const _0x5c5e55=_0x5f1b9e;return _0x488984[_0x5c5e55('0x1')]['changeColumn'](_0x55cba1,_0x697ea0,_0x7573d0)['then'](function(){const _0x5162f1=_0x5c5e55;logger[_0x5162f1('0xc')](_0x5162f1('0x3'),_0x697ea0,_0x55cba1);})[_0x5c5e55('0x26')](function(_0x7bf893){const _0x19d080=_0x5c5e55;logger['info'](JSON[_0x19d080('0x22')](_0x7bf893));});});},Migration[_0x4f5e86('0xb')][_0x4f5e86('0x27')]=function(_0x4863f3,_0x1bd8f8,_0x37d451){const _0xe52518=_0x4f5e86,_0x4fce3b=this;this[_0xe52518('0x6')][_0xe52518('0x1a')](function(){return _0x4fce3b['queryInterface']['addColumn'](_0x4863f3,_0x1bd8f8,_0x37d451)['then'](function(){const _0x158169=a916_0xa2d6;logger[_0x158169('0xc')](_0x158169('0x8'),_0x1bd8f8,_0x4863f3);})['catch'](function(_0x27eb9f){const _0xa0ba50=a916_0xa2d6;logger['info'](JSON[_0xa0ba50('0x22')](_0x27eb9f));});});},Migration['prototype']['dropTable']=function(_0x12ff07){const _0x3f7918=_0x4f5e86,_0x7f00ee=this;this[_0x3f7918('0x6')]['enqueue'](function(){const _0x58d3f9=_0x3f7918;return _0x7f00ee[_0x58d3f9('0x1')][_0x58d3f9('0x7')](_0x12ff07,{'force':!![]})[_0x58d3f9('0x13')](function(){const _0x45126c=_0x58d3f9;logger[_0x45126c('0xc')]('table\x20dropped\x20%s',_0x12ff07);})[_0x58d3f9('0x26')](function(_0x47c374){const _0x1c28ca=_0x58d3f9;logger['info'](JSON[_0x1c28ca('0x22')](_0x47c374));});});},Migration['prototype'][_0x4f5e86('0x19')]=function(_0x3f990f,_0x25ede7,_0x57f43c){const _0x1e5b74=_0x4f5e86,_0xc6b737=this;this[_0x1e5b74('0x6')][_0x1e5b74('0x1a')](function(){const _0x2ae61b=_0x1e5b74;return _0xc6b737[_0x2ae61b('0x1')][_0x2ae61b('0x19')](_0x3f990f,_0x25ede7,{'indexName':_0x57f43c})[_0x2ae61b('0x13')](function(){const _0x1a3d06=_0x2ae61b;logger[_0x1a3d06('0xc')](_0x1a3d06('0x15'),_0x3f990f,_0x25ede7[_0x1a3d06('0x5')](','),_0x57f43c);})['catch'](function(_0x1661e4){logger['info'](JSON['stringify'](_0x1661e4));});});},Migration[_0x4f5e86('0xb')][_0x4f5e86('0xe')]=function(_0xc1fa42){const _0x1cd141=_0x4f5e86,_0x16903c=this;this[_0x1cd141('0x6')]['enqueue'](function(){const _0x106cfb=_0x1cd141;return _0x16903c[_0x106cfb('0x1')]['sequelize'][_0x106cfb('0xe')](_0xc1fa42)[_0x106cfb('0x13')](function(){const _0x4ba287=_0x106cfb;logger[_0x4ba287('0xc')](_0x4ba287('0x0'),_0xc1fa42);})[_0x106cfb('0x26')](function(_0x4efb13){const _0x2ae26e=_0x106cfb;logger['info'](JSON[_0x2ae26e('0x22')](_0x4efb13));});});},Migration[_0x4f5e86('0xb')][_0x4f5e86('0x1b')]=function(_0x4f3527,_0x5760d8){const _0x34e729=_0x4f5e86,_0x3a33d7=this;this[_0x34e729('0x6')]['enqueue'](function(){const _0x34608f=_0x34e729;return _0x3a33d7[_0x34608f('0x1')][_0x34608f('0x1b')](_0x4f3527,_0x5760d8)['then'](function(){const _0x3d643f=_0x34608f;logger[_0x3d643f('0xc')]('Removed\x20column\x20%s\x20from\x20%s',_0x5760d8,_0x4f3527);})['catch'](function(_0x52c795){const _0xac1420=_0x34608f;logger[_0xac1420('0xc')](util['inspect'](_0x52c795,{'showHidden':![],'depth':null}));});});},Migration['prototype'][_0x4f5e86('0x9')]=function(_0x166d26){const _0x4ebf0c=_0x4f5e86;this['sequence'][_0x4ebf0c('0x1a')](function(){return _0x166d26();});},module[_0x4f5e86('0x28')]={'up':function(_0x5b0238,_0x20ef79){return new Promise(function(_0x3f9b1b){const _0x3381bd=a916_0xa2d6,_0x45dfe8=new Migration(_0x5b0238);_0x45dfe8[_0x3381bd('0x27')](_0x3381bd('0x1c'),_0x3381bd('0x18'),{'type':_0x20ef79['STRING']}),_0x45dfe8[_0x3381bd('0x27')](_0x3381bd('0x1c'),_0x3381bd('0x2'),{'type':_0x20ef79[_0x3381bd('0x1f')]}),_0x45dfe8[_0x3381bd('0x27')](_0x3381bd('0x16'),_0x3381bd('0x11'),{'type':_0x20ef79[_0x3381bd('0x1f')]}),exec(cmd,function(_0x3430a3,_0xba6b09,_0x409147){const _0x5902d1=_0x3381bd;logger[_0x5902d1('0xc')]('Exec\x20chmod','\x20Error\x20:',JSON[_0x5902d1('0x22')](_0x3430a3),_0xba6b09,_0x409147),exec(ls,function(_0x4ee4bf,_0x281e8d,_0x2df73a){const _0x4e5ea5=_0x5902d1;logger[_0x4e5ea5('0xc')](_0x4e5ea5('0x14'),_0x4e5ea5('0xa'),JSON[_0x4e5ea5('0x22')](_0x4ee4bf),_0x281e8d,_0x2df73a);});}),_0x45dfe8[_0x3381bd('0x7')](_0x3381bd('0x17')),_0x45dfe8[_0x3381bd('0x27')](_0x3381bd('0x21'),_0x3381bd('0xf'),{'type':_0x20ef79[_0x3381bd('0x23')]}),_0x45dfe8['query']('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'),_0x45dfe8[_0x3381bd('0x27')](_0x3381bd('0x12'),_0x3381bd('0x29'),{'type':_0x20ef79['STRING'],'defaultValue':'no'}),_0x45dfe8['final'](_0x3f9b1b);});},'down':function(){}};
\ No newline at end of file
+const a1078_0x2ea9=['\x20Error\x20:','util','chown\x20motion:asterisk\x20/var/opt/motion2/server/files/attachments','Ls\x20:','addIndex','dropTable','changeColumn','addColumn','sms_messages','sequence','fax_messages','catch','sequelize','tail','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','messageId','query','exec','fax_applications','queryInterface','STRING','Exec\x20chmod','exports','token','join','INTEGER','then','stringify','Changed\x20column\x20%s\x20in\x20table\x20%s','prototype','remote','child_process','addIndex\x20%s\x20%s\x20%s','migration','tools_trunks','../config/logger','inspect','removeColumn','enqueue','sms_accounts','finally','final'];(function(_0x1323dc,_0x276973){const _0x2ea95f=function(_0x11af3d){while(--_0x11af3d){_0x1323dc['push'](_0x1323dc['shift']());}};_0x2ea95f(++_0x276973);}(a1078_0x2ea9,0x1c2));const a1078_0x11af=function(_0x1323dc,_0x276973){_0x1323dc=_0x1323dc-0x1dc;let _0x2ea95f=a1078_0x2ea9[_0x1323dc];return _0x2ea95f;};const a1078_0x21f94f=a1078_0x11af;'use strict';const logger=require(a1078_0x21f94f(0x1ec))(a1078_0x21f94f(0x1ea)),util=require(a1078_0x21f94f(0x1f4)),exec=require(a1078_0x21f94f(0x1e8))[a1078_0x21f94f(0x205)],cmd=a1078_0x21f94f(0x1f5),ls='ls\x20-la\x20/var/opt/motion2/server/files',Sequence=function(){};Sequence[a1078_0x21f94f(0x1e6)]['enqueue']=function(_0x39384c){const _0x5ab2e0=a1078_0x21f94f;this[_0x5ab2e0(0x200)]=this[_0x5ab2e0(0x200)]?this[_0x5ab2e0(0x200)][_0x5ab2e0(0x1f1)](_0x39384c):_0x39384c();};const Migration=function(_0x1d2fdf){const _0x5c8cb9=a1078_0x21f94f;this[_0x5c8cb9(0x1dc)]=_0x1d2fdf,this['sequence']=new Sequence();};Migration[a1078_0x21f94f(0x1e6)][a1078_0x21f94f(0x1f9)]=function(_0x1bf99e,_0x4e24d5,_0x6b07c3){const _0x3d7e40=a1078_0x21f94f,_0x241363=this;this[_0x3d7e40(0x1fc)][_0x3d7e40(0x1ef)](function(){const _0x109396=_0x3d7e40;return _0x241363[_0x109396(0x1dc)][_0x109396(0x1f9)](_0x1bf99e,_0x4e24d5,_0x6b07c3)[_0x109396(0x1e3)](function(){const _0xd4cf1a=_0x109396;logger[_0xd4cf1a(0x202)](_0xd4cf1a(0x1e5),_0x4e24d5,_0x1bf99e);})['catch'](function(_0x1f3f69){const _0x55fb5d=_0x109396;logger[_0x55fb5d(0x202)](JSON['stringify'](_0x1f3f69));});});},Migration[a1078_0x21f94f(0x1e6)][a1078_0x21f94f(0x1fa)]=function(_0x41ddad,_0x55a4cb,_0x5c0b9c){const _0xe745fc=a1078_0x21f94f,_0xefbee3=this;this[_0xe745fc(0x1fc)][_0xe745fc(0x1ef)](function(){const _0x39dcfc=_0xe745fc;return _0xefbee3[_0x39dcfc(0x1dc)][_0x39dcfc(0x1fa)](_0x41ddad,_0x55a4cb,_0x5c0b9c)['then'](function(){const _0x5cac25=_0x39dcfc;logger[_0x5cac25(0x202)]('Added\x20column\x20%s\x20to\x20%s',_0x55a4cb,_0x41ddad);})[_0x39dcfc(0x1fe)](function(_0x514446){const _0x43ccc4=_0x39dcfc;logger['info'](JSON[_0x43ccc4(0x1e4)](_0x514446));});});},Migration[a1078_0x21f94f(0x1e6)][a1078_0x21f94f(0x1f8)]=function(_0x42cb46){const _0x4af622=a1078_0x21f94f,_0x4c1adf=this;this['sequence'][_0x4af622(0x1ef)](function(){const _0xee8c5f=_0x4af622;return _0x4c1adf[_0xee8c5f(0x1dc)][_0xee8c5f(0x1f8)](_0x42cb46,{'force':!![]})[_0xee8c5f(0x1e3)](function(){const _0x5d9181=_0xee8c5f;logger[_0x5d9181(0x202)]('table\x20dropped\x20%s',_0x42cb46);})[_0xee8c5f(0x1fe)](function(_0x5617b6){const _0x35cb66=_0xee8c5f;logger['info'](JSON[_0x35cb66(0x1e4)](_0x5617b6));});});},Migration[a1078_0x21f94f(0x1e6)][a1078_0x21f94f(0x1f7)]=function(_0x299405,_0x20a1c7,_0x1435b7){const _0x1f4ebf=a1078_0x21f94f,_0x2291ee=this;this[_0x1f4ebf(0x1fc)][_0x1f4ebf(0x1ef)](function(){const _0xb6a159=_0x1f4ebf;return _0x2291ee['queryInterface'][_0xb6a159(0x1f7)](_0x299405,_0x20a1c7,{'indexName':_0x1435b7})[_0xb6a159(0x1e3)](function(){const _0xb1f677=_0xb6a159;logger[_0xb1f677(0x202)](_0xb1f677(0x1e9),_0x299405,_0x20a1c7[_0xb1f677(0x1e1)](','),_0x1435b7);})[_0xb6a159(0x1fe)](function(_0x2f1a6a){const _0x2ee158=_0xb6a159;logger[_0x2ee158(0x202)](JSON['stringify'](_0x2f1a6a));});});},Migration[a1078_0x21f94f(0x1e6)][a1078_0x21f94f(0x204)]=function(_0x13c3fb){const _0xa72fc6=a1078_0x21f94f,_0x50931f=this;this['sequence'][_0xa72fc6(0x1ef)](function(){const _0x416e94=_0xa72fc6;return _0x50931f[_0x416e94(0x1dc)][_0x416e94(0x1ff)][_0x416e94(0x204)](_0x13c3fb)[_0x416e94(0x1e3)](function(){const _0x9e304e=_0x416e94;logger[_0x9e304e(0x202)]('query\x20%s',_0x13c3fb);})[_0x416e94(0x1fe)](function(_0xf87b69){const _0x532506=_0x416e94;logger[_0x532506(0x202)](JSON[_0x532506(0x1e4)](_0xf87b69));});});},Migration[a1078_0x21f94f(0x1e6)][a1078_0x21f94f(0x1ee)]=function(_0xfd4568,_0xf3722a){const _0x50bf5f=a1078_0x21f94f,_0x3c207b=this;this[_0x50bf5f(0x1fc)][_0x50bf5f(0x1ef)](function(){const _0x533929=_0x50bf5f;return _0x3c207b[_0x533929(0x1dc)][_0x533929(0x1ee)](_0xfd4568,_0xf3722a)[_0x533929(0x1e3)](function(){const _0x5cd0fb=_0x533929;logger[_0x5cd0fb(0x202)]('Removed\x20column\x20%s\x20from\x20%s',_0xf3722a,_0xfd4568);})['catch'](function(_0x4c659e){const _0x2fe840=_0x533929;logger[_0x2fe840(0x202)](util[_0x2fe840(0x1ed)](_0x4c659e,{'showHidden':![],'depth':null}));});});},Migration[a1078_0x21f94f(0x1e6)][a1078_0x21f94f(0x1f2)]=function(_0x338b02){const _0x52f46d=a1078_0x21f94f;this[_0x52f46d(0x1fc)][_0x52f46d(0x1ef)](function(){return _0x338b02();});},module[a1078_0x21f94f(0x1df)]={'up':function(_0x33806e,_0x367559){return new Promise(function(_0x733ed9){const _0x179497=a1078_0x11af,_0x57c57e=new Migration(_0x33806e);_0x57c57e[_0x179497(0x1fa)](_0x179497(0x1f0),_0x179497(0x1e7),{'type':_0x367559[_0x179497(0x1dd)]}),_0x57c57e[_0x179497(0x1fa)](_0x179497(0x1f0),_0x179497(0x1e0),{'type':_0x367559[_0x179497(0x1dd)]}),_0x57c57e['addColumn'](_0x179497(0x1fb),_0x179497(0x203),{'type':_0x367559[_0x179497(0x1dd)]}),exec(cmd,function(_0x59b32f,_0x4a8ad6,_0x2781e4){const _0x170118=_0x179497;logger[_0x170118(0x202)](_0x170118(0x1de),_0x170118(0x1f3),JSON[_0x170118(0x1e4)](_0x59b32f),_0x4a8ad6,_0x2781e4),exec(ls,function(_0x23ebfb,_0x3935c2,_0x52f5e0){const _0x551afb=_0x170118;logger[_0x551afb(0x202)](_0x551afb(0x1f6),'\x20Error\x20:',JSON[_0x551afb(0x1e4)](_0x23ebfb),_0x3935c2,_0x52f5e0);});}),_0x57c57e['dropTable'](_0x179497(0x206)),_0x57c57e[_0x179497(0x1fa)](_0x179497(0x1fd),'AttachmentId',{'type':_0x367559[_0x179497(0x1e2)]}),_0x57c57e['query'](_0x179497(0x201)),_0x57c57e[_0x179497(0x1fa)](_0x179497(0x1eb),'t38pt_udptl',{'type':_0x367559[_0x179497(0x1dd)],'defaultValue':'no'}),_0x57c57e[_0x179497(0x1f2)](_0x733ed9);});},'down':function(){}};
\ No newline at end of file