Fix broken queries in Drupal 6 migration.

This commit is contained in:
Miro Michalicka 2018-03-31 17:53:40 +02:00
parent cddaad7a55
commit 8d283e78e7
1 changed files with 5 additions and 5 deletions

View File

@ -115,8 +115,8 @@ class ImportScripts::Drupal < ImportScripts::Base
FROM node n FROM node n
LEFT JOIN forum f ON f.vid=n.vid LEFT JOIN forum f ON f.vid=n.vid
LEFT JOIN node_revisions nr ON nr.vid=n.vid LEFT JOIN node_revisions nr ON nr.vid=n.vid
WHERE node.type = 'forum' WHERE n.type = 'forum'
AND node.status = 1 AND n.status = 1
LIMIT #{batch_size} LIMIT #{batch_size}
OFFSET #{offset}; OFFSET #{offset};
", cache_rows: false) ", cache_rows: false)
@ -152,9 +152,9 @@ class ImportScripts::Drupal < ImportScripts::Base
SELECT COUNT(*) count SELECT COUNT(*) count
FROM comments c FROM comments c
LEFT JOIN node n ON n.nid=c.nid LEFT JOIN node n ON n.nid=c.nid
WHERE node.type IN #{node_types} WHERE n.type IN #{node_types}
AND node.status = 1 AND n.status = 1
AND comments.status=0; AND c.status=0;
").first['count'] ").first['count']
batch_size = 1000 batch_size = 1000