Skip to content

Commit

Permalink
feat: only migration white list data
Browse files Browse the repository at this point in the history
  • Loading branch information
xudafeng committed Feb 12, 2018
1 parent 0b171ca commit c816c5f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.34 / 2018-02-12

* feat: only migration white list data

# 1.0.33 / 2018-02-07

* feat: update checker supported
Expand Down
6 changes: 6 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ module.exports = app => {
try {
const list = JSON.parse(content);

app.whiteList = list.map(item => {
return {
identifer: item.identifer,
};
});

for (let i = 0; i < list.length; i++) {
const data = list[i];
const {
Expand Down
4 changes: 3 additions & 1 deletion app/controller/api/data.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use strict';

const {
Controller,
} = require('egg');
const _ = require('xutil');
const Controller = require('egg').Controller;

const allowedProxyHeaders = [
'set-cookie',
Expand Down
3 changes: 3 additions & 0 deletions app/service/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class DataService extends Service {

async asyncMigration() {
const res = await this.ctx.model.Data.findAll({
where: {
[this.app.Sequelize.Op.or]: this.ctx.app.whiteList || [],
},
raw: true,
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "macaca-datahub",
"version": "1.0.33",
"version": "1.0.34",
"description": "Continuous data provider for development, testing, staging and production.",
"bin": {
"datahub": "./bin/datahub.js"
Expand Down

0 comments on commit c816c5f

Please sign in to comment.