<commit_before><?php

namespace OpenOrchestra\MigrationBundle\Migrations;

use Doctrine\MongoDB\Database;

/**
 * @package OpenOrchestra\MigrationBundle\Migrations
 */
class Version20170503155919 extends AbstractMigration
{
    /**
     * @return string
     */
    public function getDescription()
    {
        return "Update trash item";
    }

    /**
     * @param Database $db
     */
    public function up(Database $db)
    {
        $db->execute('
            var distinctItemIds = [];
            db.trash_item.find({}).snapshot().forEach(function(media) {
                var entity = db[item.entity.getCollection()].findOne({_id: item.entity.getId()});
                if (null !== entity) {
                    item.siteId = entity.siteId;
                    if ("node" === item.type) {
                        item.entityId = entity.nodeId;
                    } else if ("content" === item.type) {
                        item.entityId = entity.contentId;
                    }<commit_msg>fix error parameter<commit_after><?php

namespace OpenOrchestra\MigrationBundle\Migrations;

use Doctrine\MongoDB\Database;

/**
 * @package OpenOrchestra\MigrationBundle\Migrations
 */
class Version20170503155919 extends AbstractMigration
{
    /**
     * @return string
     */
    public function getDescription()
    {
        return "Update trash item";
    }

    /**
     * @param Database $db
     */
    public function up(Database $db)
    {
        $db->execute('
            var distinctItemIds = [];
            db.trash_item.find({}).snapshot().forEach(function(item) {
                var entity = db[item.entity.getCollection()].findOne({_id: item.entity.getId()});
                if (null !== entity) {
                    item.siteId = entity.siteId;
                    if ("node" === item.type) {
                        item.entityId = entity.nodeId;
                    } else if ("content" === item.type) {
                        item.entityId = entity.contentId;
                    }
{'fraction_non_alphanumeric': 0.1250620347394541, 'fraction_numerical': 0.013895781637717122, 'mean_word_length': 1.7730398899587345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2269657', 'n_tokens_mistral': 569, 'n_tokens_neox': 549, 'n_words': 104}