<DBMIGRATION type="mod/journal" VERSION="2005120100">
  <TABLES>
    <TABLE name="journal_entries">
      <FIELDS>
        <FIELD name="text" method="PLAIN_SQL_UPDATE" type="text" length="0">
          <SQL_DETECT_USER>
           SELECT je.userid
           FROM {$CFG->prefix}journal_entries je
           WHERE je.id = RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT j.course
           FROM {$CFG->prefix}journal j,
                {$CFG->prefix}journal_entries je
           WHERE j.id = je.journal
                 AND je.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
        <FIELD name="comment" method="PLAIN_SQL_UPDATE" type="text" length="0">
          <SQL_DETECT_USER>
           SELECT je.userid
           FROM {$CFG->prefix}journal_entries je
           WHERE je.id = RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT j.course
           FROM {$CFG->prefix}journal j,
                {$CFG->prefix}journal_entries je
           WHERE j.id = je.journal
                 AND je.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="journal">
      <FIELDS>
        <FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
           migrate2utf8_journal_name(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="intro" method="PHP_FUNCTION" type="text" length="0">
          <PHP_FUNCTION>
           migrate2utf8_journal_intro(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
      </FIELDS>
    </TABLE>
  </TABLES>
</DBMIGRATION>
