2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Merge pull request #6314 from halfdan/6287-import

Only import tables defined in core/server/data/schema.js
This commit is contained in:
Hannah Wolfe 2016-01-19 15:22:24 +00:00
commit 1b5b6cf6e3

View file

@ -79,7 +79,8 @@ checkDuplicateAttributes = function checkDuplicateAttributes(data, comparedValue
sanitize = function sanitize(data) {
var allProblems = {},
tableNames = _.sortBy(_.keys(data.data), function (tableName) {
tablesInData = _.keys(data.data),
tableNames = _.sortBy(_.keys(tables), function (tableName) {
// We want to guarantee posts and tags go first
if (tableName === 'posts') {
return 1;
@ -90,6 +91,8 @@ sanitize = function sanitize(data) {
return 3;
});
tableNames = _.intersection(tableNames, tablesInData);
_.each(tableNames, function (tableName) {
// Sanitize the table data for duplicates and valid uuid and created_at values
var sanitizedTableData = _.transform(data.data[tableName], function (memo, importValues) {