Built motion from commit 82a371561bcdbc7605c801e5e414f4032ba9e7ad. Version 3.0.0...
[motion-next.git] / server / migrations / 2.0.69.js
1 const a948_0x38de=['Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s','migration','query\x20%s','prototype','stringify','ALTER\x20TABLE\x20`voice_extensions`\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ADD\x20CONSTRAINT\x20`voice_extensions_ibfk_7`\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FOREIGN\x20KEY\x20(`VoicePrefixId`)\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20REFERENCES\x20voice_prefixes(`id`)\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20UPDATE\x20CASCADE\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20DELETE\x20CASCADE','../config/logger','addColumn','info','#fafafa','chat_websites','catch','prefix','INTEGER','TEXT','queryInterface','STRING','messageFontSize','tail','then','VoiceExtensionId','join','name','removeIndex\x20%s\x20%s','sequence','tools_sounds','line','report_jscripty_answers','update\x20voice_extensions\x20set\x20app\x20=\x20\x27ExecIf\x27,\x20appdata\x20=\x20CONCAT(\x27$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(\x27,\x20appdata,\x20\x27)\x27)\x20where\x20appdata\x20LIKE\x20CONCAT(\x27CALLERID(all)\x27,\x20\x27%\x27)\x20and\x20type\x20=\x20\x27outbound\x27','VoicePrefixId','DELETE\x20FROM\x20`voice_prefixes`','backgroundColor','cm_contacts','voice_extensions','callerIdAll','final','changeColumn','Changed\x20column\x20%s\x20in\x20table\x20%s','voice_prefixes','answer','removeIndex','Removed\x20column\x20%s\x20from\x20%s','finally','inspect','exports','addIndex\x20%s\x20%s\x20%s','enqueue','long','sequelize','query','removeColumn','addIndex','renameColumn','DELETE\x20FROM\x20`user_has_voice_prefixes`','table\x20dropped\x20%s','util'];(function(_0x3418cf,_0x38de5a){const _0x47c966=function(_0x5dbda0){while(--_0x5dbda0){_0x3418cf['push'](_0x3418cf['shift']());}};_0x47c966(++_0x38de5a);}(a948_0x38de,0x10d));const a948_0x47c9=function(_0x3418cf,_0x38de5a){_0x3418cf=_0x3418cf-0x0;let _0x47c966=a948_0x38de[_0x3418cf];return _0x47c966;};const _0x5e7b1c=a948_0x47c9;'use strict';const util=require(_0x5e7b1c('0xa')),logger=require(_0x5e7b1c('0x11'))(_0x5e7b1c('0xc')),Sequence=function(){};Sequence['prototype'][_0x5e7b1c('0x1')]=function(_0x5dbda0){const _0x369c28=_0x5e7b1c;this[_0x369c28('0x1d')]=this[_0x369c28('0x1d')]?this[_0x369c28('0x1d')][_0x369c28('0x35')](_0x5dbda0):_0x5dbda0();};const Migration=function(_0x50ac5e){const _0x2c7fcc=_0x5e7b1c;this['queryInterface']=_0x50ac5e,this[_0x2c7fcc('0x23')]=new Sequence();};Migration[_0x5e7b1c('0xe')][_0x5e7b1c('0x2f')]=function(_0x4bb927,_0x2ced76,_0x37c29f){const _0x2a12a5=_0x5e7b1c,_0x50f41c=this;this['sequence'][_0x2a12a5('0x1')](function(){const _0x4b04fd=_0x2a12a5;return _0x50f41c[_0x4b04fd('0x1a')][_0x4b04fd('0x2f')](_0x4bb927,_0x2ced76,_0x37c29f)[_0x4b04fd('0x1e')](function(){const _0x44da22=_0x4b04fd;logger['info'](_0x44da22('0x30'),_0x2ced76,_0x4bb927);})[_0x4b04fd('0x16')](function(_0x9ea18b){const _0x3ff745=_0x4b04fd;logger[_0x3ff745('0x13')](JSON['stringify'](_0x9ea18b));});});},Migration[_0x5e7b1c('0xe')][_0x5e7b1c('0x12')]=function(_0xa770b9,_0xeb224c,_0x3c506d){const _0x1867fa=_0x5e7b1c,_0x18b6d6=this;this[_0x1867fa('0x23')][_0x1867fa('0x1')](function(){const _0x47f941=_0x1867fa;return _0x18b6d6[_0x47f941('0x1a')][_0x47f941('0x12')](_0xa770b9,_0xeb224c,_0x3c506d)[_0x47f941('0x1e')](function(){logger['info']('Added\x20column\x20%s\x20to\x20%s',_0xeb224c,_0xa770b9);})[_0x47f941('0x16')](function(_0x1fb46e){const _0x30a040=_0x47f941;logger[_0x30a040('0x13')](JSON[_0x30a040('0xf')](_0x1fb46e));});});},Migration[_0x5e7b1c('0xe')]['dropTable']=function(_0x15a068){const _0x5177e0=_0x5e7b1c,_0x3dfe1e=this;this[_0x5177e0('0x23')]['enqueue'](function(){const _0x51080d=_0x5177e0;return _0x3dfe1e[_0x51080d('0x1a')]['dropTable'](_0x15a068,{'force':!![]})[_0x51080d('0x1e')](function(){const _0x1fca6e=_0x51080d;logger[_0x1fca6e('0x13')](_0x1fca6e('0x9'),_0x15a068);})['catch'](function(_0x51760f){const _0x35a645=_0x51080d;logger[_0x35a645('0x13')](JSON['stringify'](_0x51760f));});});},Migration[_0x5e7b1c('0xe')]['addIndex']=function(_0x35dbf2,_0x17466b,_0x2f1562){const _0x3704e2=_0x5e7b1c,_0x28b850=this;this[_0x3704e2('0x23')]['enqueue'](function(){const _0x968896=_0x3704e2;return _0x28b850[_0x968896('0x1a')][_0x968896('0x6')](_0x35dbf2,_0x17466b,{'indexName':_0x2f1562})[_0x968896('0x1e')](function(){const _0x2c7094=_0x968896;logger[_0x2c7094('0x13')](_0x2c7094('0x0'),_0x35dbf2,_0x17466b[_0x2c7094('0x20')](','),_0x2f1562);})[_0x968896('0x16')](function(_0x591aed){const _0x317670=_0x968896;logger[_0x317670('0x13')](JSON[_0x317670('0xf')](_0x591aed));});});},Migration[_0x5e7b1c('0xe')][_0x5e7b1c('0x33')]=function(_0x3838f0,_0x366d61){const _0x587789=_0x5e7b1c,_0x1907a7=this;this[_0x587789('0x23')][_0x587789('0x1')](function(){const _0xe9340d=_0x587789;return _0x1907a7[_0xe9340d('0x1a')][_0xe9340d('0x33')](_0x3838f0,_0x366d61)['then'](function(){const _0x5926b5=_0xe9340d;logger[_0x5926b5('0x13')](_0x5926b5('0x22'),_0x3838f0,_0x366d61);})[_0xe9340d('0x16')](function(_0x1587cc){const _0x28e02a=_0xe9340d;logger[_0x28e02a('0x13')](JSON[_0x28e02a('0xf')](_0x1587cc));});});},Migration[_0x5e7b1c('0xe')]['query']=function(_0x350542){const _0x43be94=this;this['sequence']['enqueue'](function(){const _0x47f86b=a948_0x47c9;return _0x43be94[_0x47f86b('0x1a')][_0x47f86b('0x3')][_0x47f86b('0x4')](_0x350542)[_0x47f86b('0x1e')](function(){const _0x2cc119=_0x47f86b;logger[_0x2cc119('0x13')](_0x2cc119('0xd'),_0x350542);})[_0x47f86b('0x16')](function(_0x3500d7){const _0x196cca=_0x47f86b;logger[_0x196cca('0x13')](JSON[_0x196cca('0xf')](_0x3500d7));});});},Migration[_0x5e7b1c('0xe')][_0x5e7b1c('0x5')]=function(_0x11f414,_0x546a34){const _0xf67a48=_0x5e7b1c,_0x53db16=this;this[_0xf67a48('0x23')]['enqueue'](function(){const _0x40f52b=_0xf67a48;return _0x53db16[_0x40f52b('0x1a')][_0x40f52b('0x5')](_0x11f414,_0x546a34)[_0x40f52b('0x1e')](function(){const _0x459b61=_0x40f52b;logger[_0x459b61('0x13')](_0x459b61('0x34'),_0x546a34,_0x11f414);})[_0x40f52b('0x16')](function(_0x3900fd){const _0x1eaeda=_0x40f52b;logger[_0x1eaeda('0x13')](util['inspect'](_0x3900fd,{'showHidden':![],'depth':null}));});});},Migration['prototype']['renameColumn']=function(_0x29febb,_0x4f1b86,_0x3e52de){const _0x45bd90=_0x5e7b1c,_0x254d52=this;this['sequence'][_0x45bd90('0x1')](function(){const _0x8171f4=_0x45bd90;return _0x254d52[_0x8171f4('0x1a')][_0x8171f4('0x7')](_0x29febb,_0x4f1b86,_0x3e52de)['then'](function(){const _0x10c6b6=_0x8171f4;logger[_0x10c6b6('0x13')](_0x10c6b6('0xb'),_0x4f1b86,_0x3e52de,_0x29febb);})[_0x8171f4('0x16')](function(_0x215d83){const _0x58a744=_0x8171f4;logger['info'](util[_0x58a744('0x36')](_0x215d83,{'showHidden':![],'depth':null}));});});},Migration[_0x5e7b1c('0xe')][_0x5e7b1c('0x2e')]=function(_0x1da824){this['sequence']['enqueue'](function(){return _0x1da824();});},module[_0x5e7b1c('0x37')]={'up':function(_0x686b81,_0xc0988b){return new Promise(function(_0x5e4b0c){const _0x55929a=a948_0x47c9,_0x1b4397=new Migration(_0x686b81);_0x1b4397['changeColumn'](_0x55929a('0x26'),_0x55929a('0x32'),{'type':_0xc0988b[_0x55929a('0x19')]('long')}),_0x1b4397[_0x55929a('0x2f')]('report_jscripty_questions','answer',{'type':_0xc0988b[_0x55929a('0x19')](_0x55929a('0x2'))}),_0x1b4397[_0x55929a('0x4')]('UPDATE\x20tools_sounds\x20S1\x20JOIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(SELECT\x20name\x20FROM\x20tools_sounds\x20GROUP\x20BY\x20name\x20HAVING\x20COUNT(id)\x20>\x201)\x20S2\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20S1.name\x20=\x20S2.name\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SET\x20S1.name\x20=\x20CONCAT(S1.name,\x20\x27_\x27,\x20LOWER(LPAD(CONV(FLOOR(RAND()*POW(36,6)),\x2010,\x2036),\x206,\x200)))'),_0x1b4397[_0x55929a('0x2f')](_0x55929a('0x24'),_0x55929a('0x21'),{'type':_0xc0988b['STRING'],'unique':!![],'allowNull':![]}),_0x1b4397[_0x55929a('0x12')](_0x55929a('0x15'),_0x55929a('0x1c'),{'type':_0xc0988b['INTEGER'],'defaultValue':0xc}),_0x1b4397[_0x55929a('0x12')]('chat_websites',_0x55929a('0x2a'),{'type':_0xc0988b['STRING'],'allowNull':![],'defaultValue':_0x55929a('0x14'),'validate':{'notEmpty':!![]}}),_0x1b4397[_0x55929a('0x12')](_0x55929a('0x2b'),_0x55929a('0x25'),{'type':_0xc0988b[_0x55929a('0x1b')]}),_0x1b4397[_0x55929a('0x4')](_0x55929a('0x29')),_0x1b4397['query'](_0x55929a('0x8')),_0x1b4397[_0x55929a('0x33')](_0x55929a('0x31'),_0x55929a('0x17')),_0x1b4397[_0x55929a('0x5')]('voice_prefixes',_0x55929a('0x17')),_0x1b4397[_0x55929a('0x12')](_0x55929a('0x31'),_0x55929a('0x2d'),{'type':_0xc0988b[_0x55929a('0x1b')]}),_0x1b4397[_0x55929a('0x12')]('voice_prefixes',_0x55929a('0x1f'),{'type':_0xc0988b[_0x55929a('0x18')]}),_0x1b4397[_0x55929a('0x12')](_0x55929a('0x2c'),_0x55929a('0x28'),{'type':_0xc0988b[_0x55929a('0x18')]}),_0x1b4397[_0x55929a('0x4')](_0x55929a('0x10')),_0x1b4397[_0x55929a('0x4')](_0x55929a('0x27')),_0x1b4397[_0x55929a('0x12')]('report_call',_0x55929a('0x17'),{'type':_0xc0988b[_0x55929a('0x1b')]}),_0x1b4397[_0x55929a('0x2e')](_0x5e4b0c);});},'down':function(){}};