a5bfab596cb395d8395b7f59f07626e8da067529
[motion-next.git] / server / migrations / 2.3.4.js
1 const a977_0x5c99=['sequence','addColumn','Changed\x20column\x20%s\x20in\x20table\x20%s','sequelize','queryInterface','query\x20%s','Removed\x20column\x20%s\x20from\x20%s','info','final','exports','removeIndex\x20%s\x20%s','dropTable','enqueue','then','finally','addIndex','catch','migration','Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s','tail','inspect','addIndex\x20%s\x20%s\x20%s','prototype','removeIndex','removeColumn','join','../config/logger','query','stringify'];(function(_0x205fed,_0x5c9931){const _0xf494ce=function(_0xd54b8f){while(--_0xd54b8f){_0x205fed['push'](_0x205fed['shift']());}};_0xf494ce(++_0x5c9931);}(a977_0x5c99,0xb0));const a977_0xf494=function(_0x205fed,_0x5c9931){_0x205fed=_0x205fed-0x0;let _0xf494ce=a977_0x5c99[_0x205fed];return _0xf494ce;};const _0xbbba8e=a977_0xf494;'use strict';const util=require('util'),logger=require(_0xbbba8e('0x18'))(_0xbbba8e('0xf')),Sequence=function(){};Sequence['prototype'][_0xbbba8e('0xa')]=function(_0xd54b8f){const _0x336aa7=_0xbbba8e;this[_0x336aa7('0x11')]=this[_0x336aa7('0x11')]?this[_0x336aa7('0x11')][_0x336aa7('0xc')](_0xd54b8f):_0xd54b8f();};const Migration=function(_0x4c1db4){const _0x1f8e1a=_0xbbba8e;this[_0x1f8e1a('0x2')]=_0x4c1db4,this[_0x1f8e1a('0x1b')]=new Sequence();};Migration['prototype']['changeColumn']=function(_0x1f996c,_0x26b06f,_0x42e4c2){const _0x4c4d45=_0xbbba8e,_0x1d8428=this;this[_0x4c4d45('0x1b')][_0x4c4d45('0xa')](function(){const _0x335602=_0x4c4d45;return _0x1d8428[_0x335602('0x2')]['changeColumn'](_0x1f996c,_0x26b06f,_0x42e4c2)[_0x335602('0xb')](function(){const _0x43f6e7=_0x335602;logger[_0x43f6e7('0x5')](_0x43f6e7('0x0'),_0x26b06f,_0x1f996c);})[_0x335602('0xe')](function(_0x4c8ff4){const _0x2275b6=_0x335602;logger[_0x2275b6('0x5')](JSON[_0x2275b6('0x1a')](_0x4c8ff4));});});},Migration[_0xbbba8e('0x14')][_0xbbba8e('0x1c')]=function(_0x331814,_0x5d4a0c,_0xfd13a2){const _0x4d8893=_0xbbba8e,_0x4b7c50=this;this[_0x4d8893('0x1b')]['enqueue'](function(){const _0x3cfb3e=_0x4d8893;return _0x4b7c50[_0x3cfb3e('0x2')][_0x3cfb3e('0x1c')](_0x331814,_0x5d4a0c,_0xfd13a2)[_0x3cfb3e('0xb')](function(){const _0x20fc52=_0x3cfb3e;logger[_0x20fc52('0x5')]('Added\x20column\x20%s\x20to\x20%s',_0x5d4a0c,_0x331814);})['catch'](function(_0x56f90d){const _0x1ea1f0=_0x3cfb3e;logger[_0x1ea1f0('0x5')](JSON[_0x1ea1f0('0x1a')](_0x56f90d));});});},Migration[_0xbbba8e('0x14')][_0xbbba8e('0x9')]=function(_0x4e29c3){const _0x4e20aa=_0xbbba8e,_0x8605b1=this;this[_0x4e20aa('0x1b')]['enqueue'](function(){const _0x109506=_0x4e20aa;return _0x8605b1[_0x109506('0x2')][_0x109506('0x9')](_0x4e29c3,{'force':!![]})[_0x109506('0xb')](function(){const _0x1ab8ea=_0x109506;logger[_0x1ab8ea('0x5')]('table\x20dropped\x20%s',_0x4e29c3);})['catch'](function(_0x5ed014){const _0x1ef41c=_0x109506;logger[_0x1ef41c('0x5')](JSON[_0x1ef41c('0x1a')](_0x5ed014));});});},Migration[_0xbbba8e('0x14')]['addIndex']=function(_0x3f8ecd,_0x542dfd,_0x4d6d79){const _0x3a11c2=_0xbbba8e,_0x93acf3=this;this[_0x3a11c2('0x1b')][_0x3a11c2('0xa')](function(){const _0x2cac23=_0x3a11c2;return _0x93acf3[_0x2cac23('0x2')][_0x2cac23('0xd')](_0x3f8ecd,_0x542dfd,{'indexName':_0x4d6d79})[_0x2cac23('0xb')](function(){const _0x5b7f68=_0x2cac23;logger[_0x5b7f68('0x5')](_0x5b7f68('0x13'),_0x3f8ecd,_0x542dfd[_0x5b7f68('0x17')](','),_0x4d6d79);})[_0x2cac23('0xe')](function(_0x307335){const _0x2d40a4=_0x2cac23;logger[_0x2d40a4('0x5')](JSON[_0x2d40a4('0x1a')](_0x307335));});});},Migration['prototype'][_0xbbba8e('0x15')]=function(_0x27e8d4,_0x4a5efc){const _0x37112=_0xbbba8e,_0x19b220=this;this['sequence'][_0x37112('0xa')](function(){const _0x4bb120=_0x37112;return _0x19b220[_0x4bb120('0x2')]['removeIndex'](_0x27e8d4,_0x4a5efc)[_0x4bb120('0xb')](function(){const _0x16e0b4=_0x4bb120;logger['info'](_0x16e0b4('0x8'),_0x27e8d4,_0x4a5efc);})['catch'](function(_0xa233ca){const _0xbc6c90=_0x4bb120;logger[_0xbc6c90('0x5')](JSON['stringify'](_0xa233ca));});});},Migration[_0xbbba8e('0x14')][_0xbbba8e('0x19')]=function(_0x1907d){const _0x153e1d=_0xbbba8e,_0x426272=this;this[_0x153e1d('0x1b')][_0x153e1d('0xa')](function(){const _0x488eb5=_0x153e1d;return _0x426272[_0x488eb5('0x2')][_0x488eb5('0x1')][_0x488eb5('0x19')](_0x1907d)[_0x488eb5('0xb')](function(){const _0x384f3b=_0x488eb5;logger[_0x384f3b('0x5')](_0x384f3b('0x3'),_0x1907d);})[_0x488eb5('0xe')](function(_0x121c61){const _0x181fa9=_0x488eb5;logger[_0x181fa9('0x5')](JSON[_0x181fa9('0x1a')](_0x121c61));});});},Migration[_0xbbba8e('0x14')][_0xbbba8e('0x16')]=function(_0x44f6a5,_0x38ac47){const _0x42a91b=_0xbbba8e,_0x3753a3=this;this[_0x42a91b('0x1b')]['enqueue'](function(){const _0x3462cf=_0x42a91b;return _0x3753a3[_0x3462cf('0x2')][_0x3462cf('0x16')](_0x44f6a5,_0x38ac47)['then'](function(){const _0x2e4914=_0x3462cf;logger[_0x2e4914('0x5')](_0x2e4914('0x4'),_0x38ac47,_0x44f6a5);})[_0x3462cf('0xe')](function(_0x158019){const _0x25ffa6=_0x3462cf;logger[_0x25ffa6('0x5')](util[_0x25ffa6('0x12')](_0x158019,{'showHidden':![],'depth':null}));});});},Migration[_0xbbba8e('0x14')]['renameColumn']=function(_0x5e2c2c,_0x633bd2,_0x318225){const _0x2ab87a=_0xbbba8e,_0x552ebc=this;this[_0x2ab87a('0x1b')][_0x2ab87a('0xa')](function(){const _0x147a92=_0x2ab87a;return _0x552ebc[_0x147a92('0x2')]['renameColumn'](_0x5e2c2c,_0x633bd2,_0x318225)['then'](function(){const _0x39731b=_0x147a92;logger['info'](_0x39731b('0x10'),_0x633bd2,_0x318225,_0x5e2c2c);})[_0x147a92('0xe')](function(_0x5b9d92){const _0x378488=_0x147a92;logger['info'](util[_0x378488('0x12')](_0x5b9d92,{'showHidden':![],'depth':null}));});});},Migration[_0xbbba8e('0x14')][_0xbbba8e('0x6')]=function(_0x1796bc){const _0x1318c6=_0xbbba8e;this[_0x1318c6('0x1b')]['enqueue'](function(){return _0x1796bc();});},module[_0xbbba8e('0x7')]={'up':function(_0x479aab){return new Promise(function(_0x170e88){const _0x21f39f=a977_0xf494,_0x1ecd4f=new Migration(_0x479aab);_0x1ecd4f[_0x21f39f('0x6')](_0x170e88);});},'down':function(){}};