3cec22ea8f2d3b3728e6323afcfd682a95924e70
[motion-next.git] / server / migrations / 2.4.5.js
1 const a1008_0x37b0=['prototype','renameColumn','query','final','changeColumn','info','Added\x20column\x20%s\x20to\x20%s','tail','queryInterface','catch','then','removeIndex\x20%s\x20%s','../config/logger','removeIndex','addIndex','enqueue','indexName','removeColumn','finally','join','stringify','dropTable','sequence','migration','inspect','indicesType'];(function(_0xd0c039,_0x37b0e0){const _0x13341c=function(_0x4459f8){while(--_0x4459f8){_0xd0c039['push'](_0xd0c039['shift']());}};_0x13341c(++_0x37b0e0);}(a1008_0x37b0,0x104));const a1008_0x1334=function(_0xd0c039,_0x37b0e0){_0xd0c039=_0xd0c039-0x0;let _0x13341c=a1008_0x37b0[_0xd0c039];return _0x13341c;};const _0x2ebbf5=a1008_0x1334;'use strict';const util=require('util'),logger=require(_0x2ebbf5('0xc'))(_0x2ebbf5('0x17')),Sequence=function(){};Sequence[_0x2ebbf5('0x0')][_0x2ebbf5('0xf')]=function(_0x4459f8){const _0x7f1f27=_0x2ebbf5;this[_0x7f1f27('0x7')]=this[_0x7f1f27('0x7')]?this[_0x7f1f27('0x7')][_0x7f1f27('0x12')](_0x4459f8):_0x4459f8();};const Migration=function(_0x35a476){const _0x348d5f=_0x2ebbf5;this[_0x348d5f('0x8')]=_0x35a476,this[_0x348d5f('0x16')]=new Sequence();};Migration[_0x2ebbf5('0x0')][_0x2ebbf5('0x4')]=function(_0x4a9a53,_0x9d874f,_0x4d09a5){const _0x2f6f70=_0x2ebbf5,_0x58e9a0=this;this[_0x2f6f70('0x16')][_0x2f6f70('0xf')](function(){const _0x3bd1c4=_0x2f6f70;return _0x58e9a0['queryInterface'][_0x3bd1c4('0x4')](_0x4a9a53,_0x9d874f,_0x4d09a5)[_0x3bd1c4('0xa')](function(){const _0x3870c3=_0x3bd1c4;logger[_0x3870c3('0x5')]('Changed\x20column\x20%s\x20in\x20table\x20%s',_0x9d874f,_0x4a9a53);})[_0x3bd1c4('0x9')](function(_0x5425fe){logger['info'](JSON['stringify'](_0x5425fe));});});},Migration[_0x2ebbf5('0x0')]['addColumn']=function(_0x3fe989,_0x71def1,_0x4f2579){const _0x5c1917=_0x2ebbf5,_0x4b2367=this;this[_0x5c1917('0x16')][_0x5c1917('0xf')](function(){const _0x410f7c=_0x5c1917;return _0x4b2367[_0x410f7c('0x8')]['addColumn'](_0x3fe989,_0x71def1,_0x4f2579)[_0x410f7c('0xa')](function(){const _0x155d3d=_0x410f7c;logger[_0x155d3d('0x5')](_0x155d3d('0x6'),_0x71def1,_0x3fe989);})[_0x410f7c('0x9')](function(_0x1eb3e8){const _0x652ec4=_0x410f7c;logger[_0x652ec4('0x5')](JSON[_0x652ec4('0x14')](_0x1eb3e8));});});},Migration[_0x2ebbf5('0x0')][_0x2ebbf5('0x15')]=function(_0x1c12c4){const _0x3edc21=_0x2ebbf5,_0xec02c9=this;this[_0x3edc21('0x16')]['enqueue'](function(){const _0x39e4d7=_0x3edc21;return _0xec02c9[_0x39e4d7('0x8')][_0x39e4d7('0x15')](_0x1c12c4,{'force':!![]})[_0x39e4d7('0xa')](function(){logger['info']('table\x20dropped\x20%s',_0x1c12c4);})['catch'](function(_0x479cb1){const _0x31e3c8=_0x39e4d7;logger['info'](JSON[_0x31e3c8('0x14')](_0x479cb1));});});},Migration[_0x2ebbf5('0x0')][_0x2ebbf5('0xe')]=function(_0x5e12c3,_0x120b46,_0x255a6b){const _0x3fe33d=_0x2ebbf5,_0x2ef1c1=this;this[_0x3fe33d('0x16')][_0x3fe33d('0xf')](function(){const _0x2a0c8b=_0x3fe33d;return _0x2ef1c1[_0x2a0c8b('0x8')][_0x2a0c8b('0xe')](_0x5e12c3,_0x120b46,{'indexName':_0x255a6b[_0x2a0c8b('0x10')],'indicesType':_0x255a6b[_0x2a0c8b('0x19')]})[_0x2a0c8b('0xa')](function(){const _0x28407b=_0x2a0c8b;logger[_0x28407b('0x5')]('addIndex\x20%s\x20%s\x20%s\x20[%s]',_0x5e12c3,_0x120b46[_0x28407b('0x13')](','),_0x255a6b[_0x28407b('0x10')],_0x255a6b['indicesType']);})[_0x2a0c8b('0x9')](function(_0x3ead03){const _0x5ddca8=_0x2a0c8b;logger[_0x5ddca8('0x5')](JSON['stringify'](_0x3ead03));});});},Migration['prototype'][_0x2ebbf5('0xd')]=function(_0x4cc8aa,_0x44ce1a){const _0xf02180=_0x2ebbf5,_0x221c8d=this;this['sequence'][_0xf02180('0xf')](function(){const _0x240109=_0xf02180;return _0x221c8d[_0x240109('0x8')]['removeIndex'](_0x4cc8aa,_0x44ce1a)[_0x240109('0xa')](function(){const _0x12d4a7=_0x240109;logger[_0x12d4a7('0x5')](_0x12d4a7('0xb'),_0x4cc8aa,_0x44ce1a);})[_0x240109('0x9')](function(_0x587813){const _0xe152b6=_0x240109;logger[_0xe152b6('0x5')](JSON[_0xe152b6('0x14')](_0x587813));});});},Migration[_0x2ebbf5('0x0')][_0x2ebbf5('0x2')]=function(_0x2751db){const _0x3619f7=_0x2ebbf5,_0x5ebfab=this;this[_0x3619f7('0x16')][_0x3619f7('0xf')](function(){const _0x2c6502=_0x3619f7;return _0x5ebfab[_0x2c6502('0x8')]['sequelize'][_0x2c6502('0x2')](_0x2751db)[_0x2c6502('0xa')](function(){logger['info']('query\x20%s',_0x2751db);})['catch'](function(_0x493be6){const _0xcdae3c=_0x2c6502;logger[_0xcdae3c('0x5')](JSON['stringify'](_0x493be6));});});},Migration[_0x2ebbf5('0x0')][_0x2ebbf5('0x11')]=function(_0x4249b6,_0x30aa33){const _0xc818c6=_0x2ebbf5,_0x3d1fb3=this;this[_0xc818c6('0x16')][_0xc818c6('0xf')](function(){const _0x5a23d7=_0xc818c6;return _0x3d1fb3[_0x5a23d7('0x8')][_0x5a23d7('0x11')](_0x4249b6,_0x30aa33)[_0x5a23d7('0xa')](function(){const _0x29da43=_0x5a23d7;logger[_0x29da43('0x5')]('Removed\x20column\x20%s\x20from\x20%s',_0x30aa33,_0x4249b6);})[_0x5a23d7('0x9')](function(_0x430789){const _0xedf619=_0x5a23d7;logger[_0xedf619('0x5')](util[_0xedf619('0x18')](_0x430789,{'showHidden':![],'depth':null}));});});},Migration[_0x2ebbf5('0x0')]['renameColumn']=function(_0xc07f31,_0x5be759,_0x557db4){const _0x1d09ab=_0x2ebbf5,_0x5750d0=this;this[_0x1d09ab('0x16')][_0x1d09ab('0xf')](function(){const _0x530684=_0x1d09ab;return _0x5750d0[_0x530684('0x8')][_0x530684('0x1')](_0xc07f31,_0x5be759,_0x557db4)['then'](function(){const _0x2f08f0=_0x530684;logger[_0x2f08f0('0x5')]('Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s',_0x5be759,_0x557db4,_0xc07f31);})[_0x530684('0x9')](function(_0x25530b){const _0x1fbe36=_0x530684;logger[_0x1fbe36('0x5')](util[_0x1fbe36('0x18')](_0x25530b,{'showHidden':![],'depth':null}));});});},Migration[_0x2ebbf5('0x0')][_0x2ebbf5('0x3')]=function(_0x513c20){const _0x4a4a4c=_0x2ebbf5;this[_0x4a4a4c('0x16')]['enqueue'](function(){return _0x513c20();});},module['exports']={'up':function(_0x3f0e7b){return new Promise(function(_0x23a480){const _0x3e91a2=new Migration(_0x3f0e7b);_0x3e91a2['final'](_0x23a480);});},'down':function(){}};