Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (18 sloc) 562 Bytes
<?php
namespace Migration;
use Marketplace\AbstractMigration;
use Silex\Application;
class CommentMarkdownCacheMigration extends AbstractMigration
{
public function appUp(Application $app)
{
foreach ($app['db']->fetchAll('SELECT id, content FROM comment') as $comment) {
$comment['content_html'] = $app['markdown']($comment['content']);
$app['db']->update('comment', $comment, array('id' => $comment['id']));
}
}
public function getMigrationInfo()
{
return 'Comment markdown cache';
}
}