deffa45e62ff750ea4ac41446ca94f9648df2d6f
[motion-next.git] / server / migrations / 3.0.0-alpha.js
1 const a1020_0x5578=['query','Renamed\x20column\x20from\x20%s\x20to\x20%s\x20on\x20%s','sequelize','inspect','finally','removeColumn','dropTable','addIndex','exports','tail','table\x20dropped\x20%s','indexName','addIndex\x20%s\x20%s\x20%s\x20[%s]','removeIndex','prototype','then','sequence','ALTER\x20TABLE\x20users\x20ADD\x20CONSTRAINT\x20`users_ibfk_1`\x20FOREIGN\x20KEY\x20(userProfileId)\x20REFERENCES\x20user_profiles(id)\x20ON\x20DELETE\x20RESTRICT','queryInterface','DROP\x20INDEX\x20`users_ibfk_1`\x20ON\x20users','final','Added\x20column\x20%s\x20to\x20%s','../config/logger','renameColumn','stringify','addColumn','catch','migration','removeIndex\x20%s\x20%s','enqueue','info','indicesType','Removed\x20column\x20%s\x20from\x20%s','ALTER\x20TABLE\x20users\x20DROP\x20FOREIGN\x20KEY\x20`users_ibfk_1`'];(function(_0x54a3d2,_0x557877){const _0x2547b3=function(_0x3807b4){while(--_0x3807b4){_0x54a3d2['push'](_0x54a3d2['shift']());}};_0x2547b3(++_0x557877);}(a1020_0x5578,0x9c));const a1020_0x2547=function(_0x54a3d2,_0x557877){_0x54a3d2=_0x54a3d2-0x0;let _0x2547b3=a1020_0x5578[_0x54a3d2];return _0x2547b3;};const _0x3cfa4d=a1020_0x2547;'use strict';const util=require('util'),logger=require(_0x3cfa4d('0x2'))(_0x3cfa4d('0x7')),Sequence=function(){};Sequence[_0x3cfa4d('0x1c')][_0x3cfa4d('0x9')]=function(_0x3807b4){const _0x25e25a=_0x3cfa4d;this[_0x25e25a('0x17')]=this['tail']?this[_0x25e25a('0x17')][_0x25e25a('0x12')](_0x3807b4):_0x3807b4();};const Migration=function(_0x176d43){const _0x1145b0=_0x3cfa4d;this['queryInterface']=_0x176d43,this[_0x1145b0('0x1e')]=new Sequence();};Migration[_0x3cfa4d('0x1c')]['changeColumn']=function(_0x15b77a,_0x2bf119,_0x1d7326){const _0x55c4e4=_0x3cfa4d,_0x33a090=this;this[_0x55c4e4('0x1e')][_0x55c4e4('0x9')](function(){const _0x173369=_0x55c4e4;return _0x33a090[_0x173369('0x20')]['changeColumn'](_0x15b77a,_0x2bf119,_0x1d7326)[_0x173369('0x1d')](function(){const _0x4734c8=_0x173369;logger[_0x4734c8('0xa')]('Changed\x20column\x20%s\x20in\x20table\x20%s',_0x2bf119,_0x15b77a);})['catch'](function(_0x13f846){const _0x5d671d=_0x173369;logger[_0x5d671d('0xa')](JSON[_0x5d671d('0x4')](_0x13f846));});});},Migration['prototype'][_0x3cfa4d('0x5')]=function(_0x137e31,_0x4d34e2,_0x5141b0){const _0x423c46=_0x3cfa4d,_0x5e68a1=this;this[_0x423c46('0x1e')]['enqueue'](function(){const _0x1a9a9a=_0x423c46;return _0x5e68a1[_0x1a9a9a('0x20')][_0x1a9a9a('0x5')](_0x137e31,_0x4d34e2,_0x5141b0)[_0x1a9a9a('0x1d')](function(){const _0x217648=_0x1a9a9a;logger[_0x217648('0xa')](_0x217648('0x1'),_0x4d34e2,_0x137e31);})[_0x1a9a9a('0x6')](function(_0x6a0e15){const _0x26799b=_0x1a9a9a;logger['info'](JSON[_0x26799b('0x4')](_0x6a0e15));});});},Migration[_0x3cfa4d('0x1c')]['dropTable']=function(_0xc0f5c5){const _0x1ed600=_0x3cfa4d,_0x2b0f5b=this;this[_0x1ed600('0x1e')][_0x1ed600('0x9')](function(){const _0x26b46e=_0x1ed600;return _0x2b0f5b['queryInterface'][_0x26b46e('0x14')](_0xc0f5c5,{'force':!![]})[_0x26b46e('0x1d')](function(){const _0x436b6d=_0x26b46e;logger[_0x436b6d('0xa')](_0x436b6d('0x18'),_0xc0f5c5);})[_0x26b46e('0x6')](function(_0x3ea94d){const _0x25afff=_0x26b46e;logger['info'](JSON[_0x25afff('0x4')](_0x3ea94d));});});},Migration[_0x3cfa4d('0x1c')][_0x3cfa4d('0x15')]=function(_0x8fc0ec,_0x56eb65,_0xec11c7){const _0x27f90e=_0x3cfa4d,_0xd22515=this;this[_0x27f90e('0x1e')][_0x27f90e('0x9')](function(){const _0x3036c1=_0x27f90e;return _0xd22515[_0x3036c1('0x20')][_0x3036c1('0x15')](_0x8fc0ec,_0x56eb65,{'indexName':_0xec11c7[_0x3036c1('0x19')],'indicesType':_0xec11c7[_0x3036c1('0xb')]})[_0x3036c1('0x1d')](function(){const _0x2c760b=_0x3036c1;logger[_0x2c760b('0xa')](_0x2c760b('0x1a'),_0x8fc0ec,_0x56eb65['join'](','),_0xec11c7['indexName'],_0xec11c7[_0x2c760b('0xb')]);})[_0x3036c1('0x6')](function(_0x385105){const _0x19af8f=_0x3036c1;logger[_0x19af8f('0xa')](JSON[_0x19af8f('0x4')](_0x385105));});});},Migration[_0x3cfa4d('0x1c')]['removeIndex']=function(_0xb503f8,_0x282596){const _0x2e7871=_0x3cfa4d,_0x5b28d6=this;this[_0x2e7871('0x1e')][_0x2e7871('0x9')](function(){const _0x4866c5=_0x2e7871;return _0x5b28d6[_0x4866c5('0x20')][_0x4866c5('0x1b')](_0xb503f8,_0x282596)[_0x4866c5('0x1d')](function(){const _0x26eef7=_0x4866c5;logger['info'](_0x26eef7('0x8'),_0xb503f8,_0x282596);})[_0x4866c5('0x6')](function(_0x5a365a){const _0x2f4887=_0x4866c5;logger[_0x2f4887('0xa')](JSON[_0x2f4887('0x4')](_0x5a365a));});});},Migration['prototype'][_0x3cfa4d('0xe')]=function(_0x5411b5){const _0x49b431=_0x3cfa4d,_0x35c86d=this;this[_0x49b431('0x1e')][_0x49b431('0x9')](function(){const _0x363cb0=_0x49b431;return _0x35c86d['queryInterface'][_0x363cb0('0x10')][_0x363cb0('0xe')](_0x5411b5)['then'](function(){const _0x886d99=_0x363cb0;logger[_0x886d99('0xa')]('query\x20%s',_0x5411b5);})[_0x363cb0('0x6')](function(_0x29bcae){const _0x41d61f=_0x363cb0;logger['info'](JSON[_0x41d61f('0x4')](_0x29bcae));});});},Migration['prototype'][_0x3cfa4d('0x13')]=function(_0x155fc9,_0x53863e){const _0x5e202d=_0x3cfa4d,_0x97ebd0=this;this[_0x5e202d('0x1e')][_0x5e202d('0x9')](function(){const _0x2e0798=_0x5e202d;return _0x97ebd0['queryInterface']['removeColumn'](_0x155fc9,_0x53863e)[_0x2e0798('0x1d')](function(){const _0x1a84a4=_0x2e0798;logger[_0x1a84a4('0xa')](_0x1a84a4('0xc'),_0x53863e,_0x155fc9);})[_0x2e0798('0x6')](function(_0x4a9cde){const _0x5e39ad=_0x2e0798;logger[_0x5e39ad('0xa')](util[_0x5e39ad('0x11')](_0x4a9cde,{'showHidden':![],'depth':null}));});});},Migration['prototype'][_0x3cfa4d('0x3')]=function(_0x309d4a,_0x4506a4,_0x354b54){const _0x750edd=_0x3cfa4d,_0x5244ce=this;this[_0x750edd('0x1e')][_0x750edd('0x9')](function(){const _0x18bc7c=_0x750edd;return _0x5244ce[_0x18bc7c('0x20')]['renameColumn'](_0x309d4a,_0x4506a4,_0x354b54)[_0x18bc7c('0x1d')](function(){const _0x584a0a=_0x18bc7c;logger[_0x584a0a('0xa')](_0x584a0a('0xf'),_0x4506a4,_0x354b54,_0x309d4a);})['catch'](function(_0x36796e){const _0x416cb3=_0x18bc7c;logger[_0x416cb3('0xa')](util[_0x416cb3('0x11')](_0x36796e,{'showHidden':![],'depth':null}));});});},Migration['prototype'][_0x3cfa4d('0x0')]=function(_0x24aedf){this['sequence']['enqueue'](function(){return _0x24aedf();});},module[_0x3cfa4d('0x16')]={'up':function(_0x306c89){return new Promise(function(_0x371096){const _0x25cd75=a1020_0x2547,_0x40750a=new Migration(_0x306c89);_0x40750a['query'](_0x25cd75('0xd')),_0x40750a[_0x25cd75('0xe')](_0x25cd75('0x21')),_0x40750a[_0x25cd75('0xe')](_0x25cd75('0x1f')),_0x40750a[_0x25cd75('0x0')](_0x371096);});},'down':function(){}};