6c82b5612650792e8d6cdd7c8baa4eb8bb80c2ba
[motion-next.git] / server / migrations / 2.0.79.js
1 const a958_0x299b=['prototype','Changed\x20column\x20%s\x20in\x20table\x20%s','inspect','dropTable','Removed\x20column\x20%s\x20from\x20%s','sequence','tail','table\x20dropped\x20%s','finally','removeIndex','stringify','enqueue','migration','changeColumn','removeColumn','then','final','queryInterface','../config/logger','query','join','query\x20%s','info','removeIndex\x20%s\x20%s','renameColumn','catch','util','addIndex','addColumn'];(function(_0x359900,_0x299bf2){const _0x44c029=function(_0x178e5b){while(--_0x178e5b){_0x359900['push'](_0x359900['shift']());}};_0x44c029(++_0x299bf2);}(a958_0x299b,0x173));const a958_0x44c0=function(_0x359900,_0x299bf2){_0x359900=_0x359900-0x0;let _0x44c029=a958_0x299b[_0x359900];return _0x44c029;};const _0x2771a7=a958_0x44c0;'use strict';const util=require(_0x2771a7('0x3')),logger=require(_0x2771a7('0x18'))(_0x2771a7('0x12')),Sequence=function(){};Sequence[_0x2771a7('0x6')]['enqueue']=function(_0x178e5b){const _0x41ff47=_0x2771a7;this[_0x41ff47('0xc')]=this['tail']?this[_0x41ff47('0xc')][_0x41ff47('0xe')](_0x178e5b):_0x178e5b();};const Migration=function(_0xa2836c){const _0x45a1b3=_0x2771a7;this[_0x45a1b3('0x17')]=_0xa2836c,this[_0x45a1b3('0xb')]=new Sequence();};Migration['prototype'][_0x2771a7('0x13')]=function(_0x2d7232,_0x34c877,_0x3a7243){const _0xf1d29a=_0x2771a7,_0x3bc850=this;this[_0xf1d29a('0xb')]['enqueue'](function(){const _0x46058e=_0xf1d29a;return _0x3bc850[_0x46058e('0x17')][_0x46058e('0x13')](_0x2d7232,_0x34c877,_0x3a7243)['then'](function(){const _0x59c4be=_0x46058e;logger[_0x59c4be('0x1c')](_0x59c4be('0x7'),_0x34c877,_0x2d7232);})[_0x46058e('0x2')](function(_0x131282){const _0x4647d8=_0x46058e;logger[_0x4647d8('0x1c')](JSON[_0x4647d8('0x10')](_0x131282));});});},Migration[_0x2771a7('0x6')][_0x2771a7('0x5')]=function(_0x363706,_0x3284ce,_0x394061){const _0x3c0a04=_0x2771a7,_0x59cef2=this;this[_0x3c0a04('0xb')]['enqueue'](function(){const _0x8f8412=_0x3c0a04;return _0x59cef2[_0x8f8412('0x17')][_0x8f8412('0x5')](_0x363706,_0x3284ce,_0x394061)[_0x8f8412('0x15')](function(){const _0x3a4cf1=_0x8f8412;logger[_0x3a4cf1('0x1c')]('Added\x20column\x20%s\x20to\x20%s',_0x3284ce,_0x363706);})[_0x8f8412('0x2')](function(_0x5123f9){const _0x194e22=_0x8f8412;logger[_0x194e22('0x1c')](JSON[_0x194e22('0x10')](_0x5123f9));});});},Migration['prototype'][_0x2771a7('0x9')]=function(_0x4b0b50){const _0x28d375=_0x2771a7,_0x23ab11=this;this['sequence'][_0x28d375('0x11')](function(){const _0x15e39e=_0x28d375;return _0x23ab11['queryInterface'][_0x15e39e('0x9')](_0x4b0b50,{'force':!![]})[_0x15e39e('0x15')](function(){const _0x5abc9c=_0x15e39e;logger['info'](_0x5abc9c('0xd'),_0x4b0b50);})[_0x15e39e('0x2')](function(_0x1889e9){const _0x59e316=_0x15e39e;logger[_0x59e316('0x1c')](JSON[_0x59e316('0x10')](_0x1889e9));});});},Migration[_0x2771a7('0x6')]['addIndex']=function(_0x180ec0,_0x389ae7,_0x3f2d89){const _0x458951=_0x2771a7,_0x4209f6=this;this[_0x458951('0xb')]['enqueue'](function(){const _0x543574=_0x458951;return _0x4209f6[_0x543574('0x17')][_0x543574('0x4')](_0x180ec0,_0x389ae7,{'indexName':_0x3f2d89})['then'](function(){const _0x3e999d=_0x543574;logger['info']('addIndex\x20%s\x20%s\x20%s',_0x180ec0,_0x389ae7[_0x3e999d('0x1a')](','),_0x3f2d89);})[_0x543574('0x2')](function(_0x16930a){const _0x52d14f=_0x543574;logger[_0x52d14f('0x1c')](JSON[_0x52d14f('0x10')](_0x16930a));});});},Migration[_0x2771a7('0x6')]['removeIndex']=function(_0x12dd3e,_0x489402){const _0x339a57=_0x2771a7,_0x366e1a=this;this['sequence'][_0x339a57('0x11')](function(){const _0x369056=_0x339a57;return _0x366e1a[_0x369056('0x17')][_0x369056('0xf')](_0x12dd3e,_0x489402)[_0x369056('0x15')](function(){const _0x37d9f8=_0x369056;logger['info'](_0x37d9f8('0x0'),_0x12dd3e,_0x489402);})[_0x369056('0x2')](function(_0x40a553){logger['info'](JSON['stringify'](_0x40a553));});});},Migration[_0x2771a7('0x6')]['query']=function(_0x31fed5){const _0x16826a=_0x2771a7,_0x24383d=this;this[_0x16826a('0xb')][_0x16826a('0x11')](function(){const _0x276fcf=_0x16826a;return _0x24383d[_0x276fcf('0x17')]['sequelize'][_0x276fcf('0x19')](_0x31fed5)[_0x276fcf('0x15')](function(){const _0x35191f=_0x276fcf;logger[_0x35191f('0x1c')](_0x35191f('0x1b'),_0x31fed5);})[_0x276fcf('0x2')](function(_0x33eb62){const _0x28cbfe=_0x276fcf;logger[_0x28cbfe('0x1c')](JSON[_0x28cbfe('0x10')](_0x33eb62));});});},Migration['prototype'][_0x2771a7('0x14')]=function(_0x51d605,_0x13b875){const _0xb14a8f=_0x2771a7,_0x49aed7=this;this['sequence'][_0xb14a8f('0x11')](function(){const _0x2f950d=_0xb14a8f;return _0x49aed7[_0x2f950d('0x17')]['removeColumn'](_0x51d605,_0x13b875)[_0x2f950d('0x15')](function(){const _0x165c17=_0x2f950d;logger['info'](_0x165c17('0xa'),_0x13b875,_0x51d605);})[_0x2f950d('0x2')](function(_0x50e86e){const _0x4580a5=_0x2f950d;logger[_0x4580a5('0x1c')](util[_0x4580a5('0x8')](_0x50e86e,{'showHidden':![],'depth':null}));});});},Migration['prototype'][_0x2771a7('0x1')]=function(_0x5e78ac,_0x426587,_0x2836b4){const _0x345c06=_0x2771a7,_0x3f77ae=this;this[_0x345c06('0xb')]['enqueue'](function(){const _0x505e72=_0x345c06;return _0x3f77ae[_0x505e72('0x17')][_0x505e72('0x1')](_0x5e78ac,_0x426587,_0x2836b4)['then'](function(){const _0x5f43e6=_0x505e72;logger[_0x5f43e6('0x1c')]('Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s',_0x426587,_0x2836b4,_0x5e78ac);})[_0x505e72('0x2')](function(_0xb5c445){const _0x33c0d0=_0x505e72;logger[_0x33c0d0('0x1c')](util[_0x33c0d0('0x8')](_0xb5c445,{'showHidden':![],'depth':null}));});});},Migration[_0x2771a7('0x6')]['final']=function(_0x35e9f6){const _0x97aad4=_0x2771a7;this[_0x97aad4('0xb')]['enqueue'](function(){return _0x35e9f6();});},module['exports']={'up':function(_0x3a67ab){return new Promise(function(_0x84e51e){const _0x1b054c=a958_0x44c0,_0x3edb36=new Migration(_0x3a67ab);_0x3edb36[_0x1b054c('0x19')]('UPDATE\x20dashboard_items\x20SET\x20attrs\x20=\x20REPLACE(attrs,\x27[{\x22name\x22:\x22attrReport\x22\x27,\x27[{\x22name\x22:\x22attrReport\x22,\x22type\x22:\x22custom\x22\x27)\x20WHERE\x20type\x20=\x20\x27web-report\x27\x20AND\x20attrs\x20NOT\x20LIKE\x20\x27%type%\x27'),_0x3edb36[_0x1b054c('0x16')](_0x84e51e);});},'down':function(){}};