<DBMIGRATION type="mod/assignment" VERSION = "2005120100">
  <TABLES>
    <TABLE name="assignment_submissions">
      <FIELDS>
        <FIELD name="data1" method="PLAIN_SQL_UPDATE" type="text" length="0">
          <SQL_DETECT_USER>
           SELECT ass.userid
           FROM {$CFG->prefix}assignment_submissions ass
           WHERE ass.id=RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT a.course
           FROM {$CFG->prefix}assignment a,
                {$CFG->prefix}assignment_submissions ass
           WHERE a.id = ass.assignment
                 AND ass.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
        <FIELD name="data2" method="PLAIN_SQL_UPDATE" type="text" length="0">
          <SQL_DETECT_USER>
           SELECT ass.userid
           FROM {$CFG->prefix}assignment_submissions ass
           WHERE ass.id=RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT a.course
           FROM {$CFG->prefix}assignment a,
                {$CFG->prefix}assignment_submissions ass
           WHERE a.id = ass.assignment
                 AND ass.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
        <FIELD name="comment" method="PLAIN_SQL_UPDATE" type="text" length="0">
          <SQL_DETECT_USER>
           SELECT ass.teacher as userid
           FROM {$CFG->prefix}assignment_submissions ass
           WHERE ass.id=RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT a.course
           FROM {$CFG->prefix}assignment a,
                {$CFG->prefix}assignment_submissions ass
           WHERE a.id = ass.assignment
                 AND ass.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="assignment">
      <FIELDS>
        <FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf_assignment_name(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="description" method="PHP_FUNCTION" type="text" length="0">
          <PHP_FUNCTION>
            migrate2utf_assignment_description(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="assignmenttype" method="NO_CONV" type="varchar" length="50" />
      </FIELDS>
    </TABLE>
  </TABLES>
</DBMIGRATION>
