Skip to content

Commit c816c5f

Browse files
committed
feat: only migration white list data
1 parent 0b171ca commit c816c5f

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.34 / 2018-02-12
2+
3+
* feat: only migration white list data
4+
15
# 1.0.33 / 2018-02-07
26

37
* feat: update checker supported

app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ module.exports = app => {
3131
try {
3232
const list = JSON.parse(content);
3333

34+
app.whiteList = list.map(item => {
35+
return {
36+
identifer: item.identifer,
37+
};
38+
});
39+
3440
for (let i = 0; i < list.length; i++) {
3541
const data = list[i];
3642
const {

app/controller/api/data.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
'use strict';
22

3+
const {
4+
Controller,
5+
} = require('egg');
36
const _ = require('xutil');
4-
const Controller = require('egg').Controller;
57

68
const allowedProxyHeaders = [
79
'set-cookie',

app/service/data.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ class DataService extends Service {
6868

6969
async asyncMigration() {
7070
const res = await this.ctx.model.Data.findAll({
71+
where: {
72+
[this.app.Sequelize.Op.or]: this.ctx.app.whiteList || [],
73+
},
7174
raw: true,
7275
});
7376

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "macaca-datahub",
3-
"version": "1.0.33",
3+
"version": "1.0.34",
44
"description": "Continuous data provider for development, testing, staging and production.",
55
"bin": {
66
"datahub": "./bin/datahub.js"

0 commit comments

Comments
 (0)