Added warning about comments w/o post in migration
This commit is contained in:
parent
1f993d37b3
commit
f39b97c072
1 changed files with 5 additions and 0 deletions
|
@ -411,6 +411,11 @@ class CopyCommentsTask extends SourcePdoTask
|
||||||
$commentDao = Injector::get(CommentDao::class);
|
$commentDao = Injector::get(CommentDao::class);
|
||||||
$this->commitInChunks($this->sourcePdo->query('SELECT * FROM comment'), function($arr) use ($commentDao)
|
$this->commitInChunks($this->sourcePdo->query('SELECT * FROM comment'), function($arr) use ($commentDao)
|
||||||
{
|
{
|
||||||
|
if (!$arr['post_id'])
|
||||||
|
{
|
||||||
|
$this->warn('Missing ID for comment #' . $arr['id']);
|
||||||
|
return;
|
||||||
|
}
|
||||||
$comment = new Comment();
|
$comment = new Comment();
|
||||||
$comment->setPostId($arr['post_id']);
|
$comment->setPostId($arr['post_id']);
|
||||||
$comment->setUserId($arr['commenter_id']);
|
$comment->setUserId($arr['commenter_id']);
|
||||||
|
|
Loading…
Reference in a new issue