9c78ca9e279f5859a397df9730f46090a5cfcceb
[motion-next.git] / server / migrations / 2.5.3.js
1 const a1016_0x30ec=['sequence','query\x20%s','util','queryInterface','dropTable','addColumn','renameColumn','prototype','stringify','removeColumn','finally','addIndex\x20%s\x20%s\x20%s\x20[%s]','removeIndex','query','Changed\x20column\x20%s\x20in\x20table\x20%s','STRING','migration','changeColumn','then','tail','join','enqueue','#011F6A','chat_websites','inspect','indexName','catch','indicesType','final','addIndex','info','Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s'];(function(_0x484844,_0x30ec7b){const _0x565736=function(_0x20f528){while(--_0x20f528){_0x484844['push'](_0x484844['shift']());}};_0x565736(++_0x30ec7b);}(a1016_0x30ec,0x123));const a1016_0x5657=function(_0x484844,_0x30ec7b){_0x484844=_0x484844-0x0;let _0x565736=a1016_0x30ec[_0x484844];return _0x565736;};const _0x191f68=a1016_0x5657;'use strict';const util=require(_0x191f68('0x1f')),logger=require('../config/logger')(_0x191f68('0xd')),Sequence=function(){};Sequence['prototype'][_0x191f68('0x12')]=function(_0x20f528){const _0x1ae23a=_0x191f68;this['tail']=this['tail']?this[_0x1ae23a('0x10')][_0x1ae23a('0x7')](_0x20f528):_0x20f528();};const Migration=function(_0x3b72fd){const _0x51a594=_0x191f68;this['queryInterface']=_0x3b72fd,this[_0x51a594('0x1d')]=new Sequence();};Migration[_0x191f68('0x4')][_0x191f68('0xe')]=function(_0x47ce20,_0x98a8c6,_0x38d77a){const _0x55a4b1=_0x191f68,_0x414007=this;this[_0x55a4b1('0x1d')]['enqueue'](function(){const _0x5c7ca6=_0x55a4b1;return _0x414007[_0x5c7ca6('0x0')][_0x5c7ca6('0xe')](_0x47ce20,_0x98a8c6,_0x38d77a)['then'](function(){const _0x5b5b20=_0x5c7ca6;logger['info'](_0x5b5b20('0xb'),_0x98a8c6,_0x47ce20);})[_0x5c7ca6('0x17')](function(_0x486390){const _0x15c0e3=_0x5c7ca6;logger[_0x15c0e3('0x1b')](JSON['stringify'](_0x486390));});});},Migration['prototype']['addColumn']=function(_0x2a35b5,_0x5cd38d,_0x25eb32){const _0x18e8b8=_0x191f68,_0x3000bb=this;this['sequence'][_0x18e8b8('0x12')](function(){const _0x3a7be7=_0x18e8b8;return _0x3000bb[_0x3a7be7('0x0')][_0x3a7be7('0x2')](_0x2a35b5,_0x5cd38d,_0x25eb32)[_0x3a7be7('0xf')](function(){const _0x329066=_0x3a7be7;logger[_0x329066('0x1b')]('Added\x20column\x20%s\x20to\x20%s',_0x5cd38d,_0x2a35b5);})[_0x3a7be7('0x17')](function(_0x258b17){const _0x23d680=_0x3a7be7;logger[_0x23d680('0x1b')](JSON[_0x23d680('0x5')](_0x258b17));});});},Migration[_0x191f68('0x4')][_0x191f68('0x1')]=function(_0x1012e5){const _0x57f36b=_0x191f68,_0x26dad=this;this['sequence'][_0x57f36b('0x12')](function(){const _0x3fdf9e=_0x57f36b;return _0x26dad[_0x3fdf9e('0x0')]['dropTable'](_0x1012e5,{'force':!![]})[_0x3fdf9e('0xf')](function(){logger['info']('table\x20dropped\x20%s',_0x1012e5);})[_0x3fdf9e('0x17')](function(_0x43a418){const _0x127c91=_0x3fdf9e;logger[_0x127c91('0x1b')](JSON[_0x127c91('0x5')](_0x43a418));});});},Migration['prototype'][_0x191f68('0x1a')]=function(_0x356500,_0xb14138,_0x2e41c4){const _0x3f9a60=_0x191f68,_0x4b2133=this;this[_0x3f9a60('0x1d')][_0x3f9a60('0x12')](function(){const _0x2865fd=_0x3f9a60;return _0x4b2133[_0x2865fd('0x0')]['addIndex'](_0x356500,_0xb14138,{'indexName':_0x2e41c4[_0x2865fd('0x16')],'indicesType':_0x2e41c4[_0x2865fd('0x18')]})[_0x2865fd('0xf')](function(){const _0x37b619=_0x2865fd;logger[_0x37b619('0x1b')](_0x37b619('0x8'),_0x356500,_0xb14138[_0x37b619('0x11')](','),_0x2e41c4[_0x37b619('0x16')],_0x2e41c4['indicesType']);})[_0x2865fd('0x17')](function(_0x339c5b){const _0x409657=_0x2865fd;logger[_0x409657('0x1b')](JSON['stringify'](_0x339c5b));});});},Migration[_0x191f68('0x4')][_0x191f68('0x9')]=function(_0x5cebb8,_0x23704b){const _0x59a9cc=_0x191f68,_0x5e11d1=this;this['sequence'][_0x59a9cc('0x12')](function(){const _0x40ea30=_0x59a9cc;return _0x5e11d1['queryInterface'][_0x40ea30('0x9')](_0x5cebb8,_0x23704b)[_0x40ea30('0xf')](function(){const _0x4ed6b4=_0x40ea30;logger[_0x4ed6b4('0x1b')]('removeIndex\x20%s\x20%s',_0x5cebb8,_0x23704b);})[_0x40ea30('0x17')](function(_0x2f8617){const _0x57a1ad=_0x40ea30;logger['info'](JSON[_0x57a1ad('0x5')](_0x2f8617));});});},Migration[_0x191f68('0x4')][_0x191f68('0xa')]=function(_0x2c9c21){const _0x237be4=_0x191f68,_0x11e858=this;this['sequence'][_0x237be4('0x12')](function(){const _0x28debd=_0x237be4;return _0x11e858['queryInterface']['sequelize'][_0x28debd('0xa')](_0x2c9c21)[_0x28debd('0xf')](function(){const _0x593d61=_0x28debd;logger[_0x593d61('0x1b')](_0x593d61('0x1e'),_0x2c9c21);})['catch'](function(_0x108234){const _0x373b7f=_0x28debd;logger[_0x373b7f('0x1b')](JSON['stringify'](_0x108234));});});},Migration[_0x191f68('0x4')]['removeColumn']=function(_0x2bd7a7,_0x2ccaa6){const _0x394aff=this;this['sequence']['enqueue'](function(){const _0x58f3c8=a1016_0x5657;return _0x394aff[_0x58f3c8('0x0')][_0x58f3c8('0x6')](_0x2bd7a7,_0x2ccaa6)[_0x58f3c8('0xf')](function(){const _0x21750f=_0x58f3c8;logger[_0x21750f('0x1b')]('Removed\x20column\x20%s\x20from\x20%s',_0x2ccaa6,_0x2bd7a7);})[_0x58f3c8('0x17')](function(_0x5748f6){const _0x1c0749=_0x58f3c8;logger['info'](util[_0x1c0749('0x15')](_0x5748f6,{'showHidden':![],'depth':null}));});});},Migration[_0x191f68('0x4')][_0x191f68('0x3')]=function(_0x50f99b,_0x5fca24,_0x3fbd41){const _0x4accb9=_0x191f68,_0x1e3fbb=this;this[_0x4accb9('0x1d')][_0x4accb9('0x12')](function(){const _0x43aee0=_0x4accb9;return _0x1e3fbb[_0x43aee0('0x0')][_0x43aee0('0x3')](_0x50f99b,_0x5fca24,_0x3fbd41)['then'](function(){const _0x4d0cf6=_0x43aee0;logger['info'](_0x4d0cf6('0x1c'),_0x5fca24,_0x3fbd41,_0x50f99b);})['catch'](function(_0x23dbee){const _0x56c9c1=_0x43aee0;logger[_0x56c9c1('0x1b')](util['inspect'](_0x23dbee,{'showHidden':![],'depth':null}));});});},Migration[_0x191f68('0x4')][_0x191f68('0x19')]=function(_0x43be0a){const _0x4a9697=_0x191f68;this[_0x4a9697('0x1d')]['enqueue'](function(){return _0x43be0a();});},module['exports']={'up':function(_0x26fd3b,_0x453113){return new Promise(function(_0x2ea2b6){const _0x44ce80=a1016_0x5657,_0xa493ba=new Migration(_0x26fd3b);_0xa493ba[_0x44ce80('0xe')](_0x44ce80('0x14'),'color',{'type':_0x453113[_0x44ce80('0xc')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}}),_0xa493ba['changeColumn'](_0x44ce80('0x14'),'color_button',{'type':_0x453113[_0x44ce80('0xc')],'allowNull':![],'defaultValue':_0x44ce80('0x13'),'validate':{'notEmpty':!![]}}),_0xa493ba[_0x44ce80('0x19')](_0x2ea2b6);});},'down':function(){}};