<DBMIGRATION type="mod/workshop" VERSION="2005120100">
  <TABLES>
    <TABLE name="workshop_submissions">
      <FIELDS>
        <FIELD name="title" method="PLAIN_SQL_UPDATE" type="varchar" length="100">
          <SQL_DETECT_USER>
           SELECT ws.userid
           FROM {$CFG->prefix}workshop_submissions ws
           WHERE ws.id=RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT w.course
           FROM {$CFG->prefix}workshop w,
                {$CFG->prefix}workshop_submissions ws
           WHERE w.id = ws.workshopid
                 AND ws.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
        <FIELD name="description" method="PLAIN_SQL_UPDATE" type="text" length="0">
          <SQL_DETECT_USER>
           SELECT ws.userid
           FROM {$CFG->prefix}workshop_submissions ws
           WHERE ws.id=RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT w.course
           FROM {$CFG->prefix}workshop w,
                {$CFG->prefix}workshop_submissions ws
           WHERE w.id = ws.workshopid
                 AND ws.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="workshop_stockcomments">
      <FIELDS>
        <FIELD name="comments" method="PHP_FUNCTION" type="text" length="0">
          <PHP_FUNCTION>
            migrate2utf8_workshop_stockcomments_comments(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="workshop_rubrics">
      <FIELDS>
        <FIELD name="description" method="PHP_FUNCTION" type="text" length="0">
          <PHP_FUNCTION>
            migrate2utf8_workshop_rubrics_description(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="workshop_grades">
      <FIELDS>
        <FIELD name="feedback" method="PHP_FUNCTION" type="text" length="0">
          <PHP_FUNCTION>
            migrate2utf8_workshop_grades_feedback(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="workshop_elements">
      <FIELDS>
        <FIELD name="description" method="PHP_FUNCTION" type="text" length="0">
          <PHP_FUNCTION>
            migrate2utf8_workshop_elements_description(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="workshop_comments">
      <FIELDS>
        <FIELD name="comments" method="PLAIN_SQL_UPDATE" type="text" length="0">
          <SQL_DETECT_USER>
           SELECT wc.userid
           FROM {$CFG->prefix}workshop_comments wc
           WHERE wc.id=RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT w.course
           FROM {$CFG->prefix}workshop w,
                {$CFG->prefix}workshop_comments wc
           WHERE w.id = wc.workshopid
                 AND wc.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="workshop_assessments">
      <FIELDS>
        <FIELD name="generalcomment" method="PLAIN_SQL_UPDATE" type="text" length="0">
          <SQL_DETECT_USER>
           SELECT wa.userid
           FROM {$CFG->prefix}workshop_assessments wa
           WHERE wa.id=RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT w.course
           FROM {$CFG->prefix}workshop w,
                {$CFG->prefix}workshop_assessments wa
           WHERE w.id = wa.workshopid
                 AND wa.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
        <FIELD name="teachercomment" method="PLAIN_SQL_UPDATE" type="text" length="0">
          <SQL_DETECT_USER>
           SELECT wa.userid
           FROM {$CFG->prefix}workshop_assessments wa
           WHERE wa.id=RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT w.course
           FROM {$CFG->prefix}workshop w,
                {$CFG->prefix}workshop_assessments wa
           WHERE w.id = wa.workshopid
                 AND wa.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="workshop">
      <FIELDS>
        <FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_workshop_name(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="description" method="PHP_FUNCTION" type="text" length="0">
          <PHP_FUNCTION>
            migrate2utf8_workshop_description(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="password" method="PHP_FUNCTION" type="varchar" length="32">
          <PHP_FUNCTION>
            migrate2utf8_workshop_password(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
      </FIELDS>
    </TABLE>
  </TABLES>
</DBMIGRATION>
