<DBMIGRATION type="mod/scorm" VERSION="2005120100">
  <TABLES>
    <TABLE name="scorm_scoes_track">
      <FIELDS>
        <FIELD name="dummy" dropindex="element" />
        <FIELD name="value" method="PLAIN_SQL_UPDATE" type="longtext" length="0">
          <SQL_DETECT_USER>
           SELECT sst.userid
           FROM {$CFG->prefix}scorm_scoes_track sst
           WHERE sst.id=RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT s.course
           FROM {$CFG->prefix}scorm s,
                {$CFG->prefix}scorm_scoes_track sst
           WHERE s.id = sst.scormid
                 AND sst.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
        <FIELD name="element" method="PLAIN_SQL_UPDATE" type="varchar" length="255" dropindex="track" addindex="track (userid, scormid, scoid, attempt, element(255))">
          <SQL_DETECT_USER>
           SELECT sst.userid
           FROM {$CFG->prefix}scorm_scoes_track sst
           WHERE sst.id=RECORDID
          </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT s.course
           FROM {$CFG->prefix}scorm s,
                {$CFG->prefix}scorm_scoes_track sst
           WHERE s.id = sst.scormid
                 AND sst.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
        <FIELD name="dummy" addindex="element (element(255))" />
      </FIELDS>
    </TABLE>
    <TABLE name="scorm_scoes">
      <FIELDS>
        <FIELD name="manifest" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_manifest(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="organization" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_organization(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="parent" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_parent(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="identifier" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_identifier(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="launch" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_launch(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="parameters" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_parameters(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="scormtype" method="PHP_FUNCTION" type="varchar" length="5">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_scormtype(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="title" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_title(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="prerequisites" method="PHP_FUNCTION" type="varchar" length="200">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_prerequisites(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="maxtimeallowed" method="PHP_FUNCTION" type="varchar" length="19">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_maxtimeallowed(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="timelimitaction" method="PHP_FUNCTION" type="varchar" length="19">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_timelimitaction(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="datafromlms" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_datafromlms(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="masteryscore" method="PHP_FUNCTION" type="varchar" length="200">
          <PHP_FUNCTION>
            migrate2utf8_scorm_scoes_masteryscore(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="scorm">
      <FIELDS>
        <FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_name(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="reference" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_reference(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="version" method="NO_CONV" type="varchar" length="9" />
        <FIELD name="summary" method="PHP_FUNCTION" type="text" length="0">
          <PHP_FUNCTION>
            migrate2utf8_scorm_summary(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="options" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_scorm_options(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
      </FIELDS>
    </TABLE>
  </TABLES>
</DBMIGRATION>
