24,25c24
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `created` datetime NOT NULL,
---
>   `created` datetime NOT NULL default '0000-00-00 00:00:00',
27,32c26,30
<   `sql1` text collate utf8_unicode_ci,
<   `params` text collate utf8_unicode_ci,
<   `tracer` text collate utf8_unicode_ci,
<   `timer` decimal(16,6) NOT NULL default '0.000000',
<   PRIMARY KEY  (`id`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to save some logs from ADOdb';
---
>   `sql1` text collate utf8_unicode_ci NOT NULL,
>   `params` text collate utf8_unicode_ci NOT NULL,
>   `tracer` text collate utf8_unicode_ci NOT NULL,
>   `timer` decimal(16,6) NOT NULL default '0.000000'
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
49,50c47,48
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
53c51
<   `format` smallint(4) unsigned NOT NULL default '0',
---
>   `format` tinyint(4) unsigned NOT NULL default '0',
58,67c56,65
<   `var1` bigint(10) default '0',
<   `var2` bigint(10) default '0',
<   `var3` bigint(10) default '0',
<   `var4` bigint(10) default '0',
<   `var5` bigint(10) default '0',
<   `maxbytes` bigint(10) unsigned NOT NULL default '100000',
<   `timedue` bigint(10) unsigned NOT NULL default '0',
<   `timeavailable` bigint(10) unsigned NOT NULL default '0',
<   `grade` bigint(10) NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `var1` int(10) default '0',
>   `var2` int(10) default '0',
>   `var3` int(10) default '0',
>   `var4` int(10) default '0',
>   `var5` int(10) default '0',
>   `maxbytes` int(10) unsigned NOT NULL default '100000',
>   `timedue` int(10) unsigned NOT NULL default '0',
>   `timeavailable` int(10) unsigned NOT NULL default '0',
>   `grade` int(10) NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
69c67
<   KEY `mdl_assi_cou_ix` (`course`)
---
>   KEY `course` (`course`)
87,92c85,90
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `assignment` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `numfiles` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `assignment` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `numfiles` int(10) unsigned NOT NULL default '0',
95c93
<   `grade` bigint(11) NOT NULL default '0',
---
>   `grade` int(11) NOT NULL default '0',
97,99c95,97
<   `format` smallint(4) unsigned NOT NULL default '0',
<   `teacher` bigint(10) unsigned NOT NULL default '0',
<   `timemarked` bigint(10) unsigned NOT NULL default '0',
---
>   `format` tinyint(4) unsigned NOT NULL default '0',
>   `teacher` int(10) unsigned NOT NULL default '0',
>   `timemarked` int(10) unsigned NOT NULL default '0',
102,105c100,103
<   KEY `mdl_assisubm_use_ix` (`userid`),
<   KEY `mdl_assisubm_mai_ix` (`mailed`),
<   KEY `mdl_assisubm_tim_ix` (`timemarked`),
<   KEY `mdl_assisubm_ass_ix` (`assignment`)
---
>   KEY `assignment` (`assignment`),
>   KEY `userid` (`userid`),
>   KEY `mailed` (`mailed`),
>   KEY `timemarked` (`timemarked`)
123c121
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
127c125
<   UNIQUE KEY `mdl_backconf_nam_uix` (`name`)
---
>   UNIQUE KEY `name` (`name`)
146,149c144,147
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `laststarttime` bigint(10) unsigned NOT NULL default '0',
<   `lastendtime` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `laststarttime` int(10) unsigned NOT NULL default '0',
>   `lastendtime` int(10) unsigned NOT NULL default '0',
151c149
<   `nextstarttime` bigint(10) unsigned NOT NULL default '0',
---
>   `nextstarttime` int(10) unsigned NOT NULL default '0',
153c151
<   UNIQUE KEY `mdl_backcour_cou_uix` (`courseid`)
---
>   UNIQUE KEY `courseid` (`courseid`)
171,172c169,170
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `backup_code` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `backup_code` int(10) unsigned NOT NULL default '0',
175,176c173,174
<   `old_id` bigint(10) unsigned NOT NULL default '0',
<   `new_id` bigint(10) unsigned NOT NULL default '0',
---
>   `old_id` int(10) unsigned NOT NULL default '0',
>   `new_id` int(10) unsigned NOT NULL default '0',
178,179c176,177
<   UNIQUE KEY `mdl_backfile_bacfilpat_uix` (`backup_code`,`file_type`,`path`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='To store and recode ids to user and course files';
---
>   UNIQUE KEY `backup_files_uk` (`backup_code`,`file_type`,`path`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='To store and recode ids to user and course files.';
196,197c194,195
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `backup_code` bigint(12) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `backup_code` int(12) unsigned NOT NULL default '0',
199,200c197,198
<   `old_id` bigint(10) unsigned NOT NULL default '0',
<   `new_id` bigint(10) unsigned NOT NULL default '0',
---
>   `old_id` int(10) unsigned NOT NULL default '0',
>   `new_id` int(10) unsigned NOT NULL default '0',
203c201
<   UNIQUE KEY `mdl_backids_bactabold_uix` (`backup_code`,`table_name`,`old_id`)
---
>   UNIQUE KEY `backup_ids_uk` (`backup_code`,`table_name`,`old_id`)
221,224c219,222
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `time` bigint(10) unsigned NOT NULL default '0',
<   `laststarttime` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `time` int(10) unsigned NOT NULL default '0',
>   `laststarttime` int(10) unsigned NOT NULL default '0',
226,227c224
<   PRIMARY KEY  (`id`),
<   KEY `mdl_backlog_cou_ix` (`courseid`)
---
>   PRIMARY KEY  (`id`)
245c242
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
247,249c244,246
<   `version` bigint(10) unsigned NOT NULL default '0',
<   `cron` bigint(10) unsigned NOT NULL default '0',
<   `lastcron` bigint(10) unsigned NOT NULL default '0',
---
>   `version` int(10) NOT NULL default '0',
>   `cron` int(10) unsigned NOT NULL default '0',
>   `lastcron` int(10) unsigned NOT NULL default '0',
253c250
< ) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to store installed blocks';
---
> ) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
271,273c268,270
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `blockid` bigint(10) unsigned NOT NULL default '0',
<   `pageid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) NOT NULL auto_increment,
>   `blockid` int(10) NOT NULL default '0',
>   `pageid` int(10) NOT NULL default '0',
276c273
<   `weight` smallint(3) NOT NULL default '0',
---
>   `weight` tinyint(3) NOT NULL default '0',
280,283c277,279
<   KEY `mdl_blocinst_pag_ix` (`pageid`),
<   KEY `mdl_blocinst_pag2_ix` (`pagetype`),
<   KEY `mdl_blocinst_blo_ix` (`blockid`)
< ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to store block instances in pages';
---
>   KEY `pageid` (`pageid`),
>   KEY `pagetype` (`pagetype`)
> ) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
301,302c297,298
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `blockid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) NOT NULL auto_increment,
>   `blockid` int(10) NOT NULL default '0',
305c301
<   `weight` smallint(3) NOT NULL default '0',
---
>   `weight` tinyint(3) NOT NULL default '0',
309,311c305,306
<   KEY `mdl_blocpinn_pag_ix` (`pagetype`),
<   KEY `mdl_blocpinn_blo_ix` (`blockid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to pin blocks';
---
>   KEY `pagetype` (`pagetype`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
328,329c323,324
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(11) NOT NULL auto_increment,
>   `userid` int(11) NOT NULL default '0',
333d327
<   `shared` tinyint(2) unsigned NOT NULL default '0',
334a329
>   `shared` int(10) unsigned NOT NULL default '0',
353,363c348,358
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `entryid` bigint(10) unsigned NOT NULL default '0',
<   `tagid` bigint(10) unsigned NOT NULL default '0',
<   `groupid` bigint(10) unsigned NOT NULL default '0',
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_blogtaginst_ent_ix` (`entryid`),
<   KEY `mdl_blogtaginst_tag_ix` (`tagid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='tag instance for blogs';
---
>   `id` int(10) NOT NULL auto_increment,
>   `entryid` int(10) NOT NULL default '0',
>   `tagid` int(10) NOT NULL default '0',
>   `groupid` int(10) NOT NULL default '0',
>   `courseid` int(10) NOT NULL default '0',
>   `userid` int(10) NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   KEY `bti_entryid_idx` (`entryid`),
>   KEY `bti_tagid_idx` (`tagid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='tag instance for blogs.';
380c375
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
382c377
<   `version` bigint(10) unsigned NOT NULL default '0',
---
>   `version` int(10) unsigned NOT NULL default '0',
385c380
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
387c382
<   KEY `mdl_cachfilt_filmd5_ix` (`filter`,`md5key`)
---
>   KEY `filtermd5key` (`filter`,`md5key`)
405c400
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
408c403
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
410c405
<   KEY `mdl_cachtext_md5_ix` (`md5key`)
---
>   KEY `md5key` (`md5key`)
429c424
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
432c427
<   `contextlevel` bigint(10) unsigned NOT NULL default '0',
---
>   `contextlevel` int(10) unsigned NOT NULL default '0',
434c429
<   `riskbitmask` bigint(10) unsigned NOT NULL default '0',
---
>   `riskbitmask` int(10) unsigned NOT NULL default '0',
436,437c431,432
<   UNIQUE KEY `mdl_capa_nam_uix` (`name`)
< ) ENGINE=MyISAM AUTO_INCREMENT=162 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='this defines all capabilities';
---
>   UNIQUE KEY `name` (`name`)
> ) ENGINE=MyISAM AUTO_INCREMENT=162 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
455,456c450,451
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
459,463c454,458
<   `keepdays` bigint(11) NOT NULL default '0',
<   `studentlogs` smallint(4) NOT NULL default '0',
<   `chattime` bigint(10) unsigned NOT NULL default '0',
<   `schedule` smallint(4) NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `keepdays` int(11) NOT NULL default '0',
>   `studentlogs` int(4) NOT NULL default '0',
>   `chattime` int(10) unsigned NOT NULL default '0',
>   `schedule` int(4) NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
465c460
<   KEY `mdl_chat_cou_ix` (`course`)
---
>   KEY `course` (`course`)
483,487c478,482
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `chatid` bigint(10) NOT NULL default '0',
<   `userid` bigint(10) NOT NULL default '0',
<   `groupid` bigint(10) NOT NULL default '0',
<   `system` tinyint(1) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `chatid` int(10) NOT NULL default '0',
>   `userid` int(10) NOT NULL default '0',
>   `groupid` int(10) NOT NULL default '0',
>   `system` int(1) unsigned NOT NULL default '0',
489c484
<   `timestamp` bigint(10) unsigned NOT NULL default '0',
---
>   `timestamp` int(10) unsigned NOT NULL default '0',
491,494c486,489
<   KEY `mdl_chatmess_use_ix` (`userid`),
<   KEY `mdl_chatmess_gro_ix` (`groupid`),
<   KEY `mdl_chatmess_timcha_ix` (`timestamp`,`chatid`),
<   KEY `mdl_chatmess_cha_ix` (`chatid`)
---
>   KEY `timemodifiedchat` (`timestamp`,`chatid`),
>   KEY `chatid` (`chatid`),
>   KEY `userid` (`userid`),
>   KEY `groupid` (`groupid`)
512,515c507,510
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `chatid` bigint(11) NOT NULL default '0',
<   `userid` bigint(11) NOT NULL default '0',
<   `groupid` bigint(11) NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `chatid` int(11) NOT NULL default '0',
>   `userid` int(11) NOT NULL default '0',
>   `groupid` int(11) NOT NULL default '0',
518,520c513,515
<   `firstping` bigint(10) unsigned NOT NULL default '0',
<   `lastping` bigint(10) unsigned NOT NULL default '0',
<   `lastmessageping` bigint(10) unsigned NOT NULL default '0',
---
>   `firstping` int(10) unsigned NOT NULL default '0',
>   `lastping` int(10) unsigned NOT NULL default '0',
>   `lastmessageping` int(10) unsigned NOT NULL default '0',
522c517
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `course` int(10) NOT NULL default '0',
525,528c520,523
<   KEY `mdl_chatuser_use_ix` (`userid`),
<   KEY `mdl_chatuser_las_ix` (`lastping`),
<   KEY `mdl_chatuser_gro_ix` (`groupid`),
<   KEY `mdl_chatuser_cha_ix` (`chatid`)
---
>   KEY `userid` (`userid`),
>   KEY `lastping` (`lastping`),
>   KEY `chatid` (`chatid`),
>   KEY `groupid` (`groupid`)
546,547c541,542
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
553c548
<   `display` smallint(4) unsigned NOT NULL default '0',
---
>   `display` tinyint(4) unsigned NOT NULL default '0',
557,562c552,558
<   `timeopen` bigint(10) unsigned NOT NULL default '0',
<   `timeclose` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_choi_cou_ix` (`course`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Available choices are stored here';
---
>   `timeopen` int(10) unsigned NOT NULL default '0',
>   `timeclose` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `id` (`id`),
>   KEY `course` (`course`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Available choices are stored here.';
579,588c575,584
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `choiceid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `optionid` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_choiansw_use_ix` (`userid`),
<   KEY `mdl_choiansw_cho_ix` (`choiceid`),
<   KEY `mdl_choiansw_opt_ix` (`optionid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='choices performed by users';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `choiceid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `optionid` int(10) NOT NULL default '0',
>   `timemodified` int(10) NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `id` (`id`),
>   KEY `userid` (`userid`),
>   KEY `choiceid` (`choiceid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
605,606c601,602
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `choiceid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `choiceid` int(10) unsigned NOT NULL default '0',
608,609c604,605
<   `maxanswers` bigint(10) unsigned default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `maxanswers` int(10) unsigned default '0',
>   `timemodified` int(10) NOT NULL default '0',
611,612c607,609
<   KEY `mdl_choiopti_cho_ix` (`choiceid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='available options to choice';
---
>   UNIQUE KEY `id` (`id`),
>   KEY `choiceid` (`choiceid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
629c626
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
633,634c630,631
<   UNIQUE KEY `mdl_conf_nam_uix` (`name`)
< ) ENGINE=MyISAM AUTO_INCREMENT=235 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Moodle configuration variables';
---
>   UNIQUE KEY `name` (`name`)
> ) ENGINE=MyISAM AUTO_INCREMENT=252 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Moodle configuration variables';
652c649
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
657c654
<   UNIQUE KEY `mdl_confplug_plunam_uix` (`plugin`,`name`)
---
>   UNIQUE KEY `plugin_name` (`plugin`,`name`)
675,677c672,674
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `contextlevel` bigint(10) unsigned NOT NULL default '0',
<   `instanceid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `contextlevel` int(10) unsigned NOT NULL default '0',
>   `instanceid` int(10) unsigned NOT NULL default '0',
680,681c677,678
<   KEY `mdl_cont_ins_ix` (`instanceid`)
< ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='one of these must be set';
---
>   KEY `instanceid` (`instanceid`)
> ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
699,701c696,698
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `category` bigint(10) unsigned NOT NULL default '0',
<   `sortorder` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `category` int(10) unsigned NOT NULL default '0',
>   `sortorder` int(10) unsigned NOT NULL default '0',
708c705
<   `showgrades` tinyint(2) unsigned NOT NULL default '1',
---
>   `showgrades` smallint(2) unsigned NOT NULL default '1',
710c707
<   `newsitems` mediumint(5) unsigned NOT NULL default '1',
---
>   `newsitems` smallint(5) unsigned NOT NULL default '1',
716,725c713,722
<   `startdate` bigint(10) unsigned NOT NULL default '0',
<   `enrolperiod` bigint(10) unsigned NOT NULL default '0',
<   `numsections` mediumint(5) unsigned NOT NULL default '1',
<   `marker` bigint(10) unsigned NOT NULL default '0',
<   `maxbytes` bigint(10) unsigned NOT NULL default '0',
<   `showreports` smallint(4) unsigned NOT NULL default '0',
<   `visible` tinyint(1) unsigned NOT NULL default '1',
<   `hiddensections` tinyint(2) unsigned NOT NULL default '0',
<   `groupmode` smallint(4) unsigned NOT NULL default '0',
<   `groupmodeforce` smallint(4) unsigned NOT NULL default '0',
---
>   `startdate` int(10) unsigned NOT NULL default '0',
>   `enrolperiod` int(10) unsigned NOT NULL default '0',
>   `numsections` smallint(5) unsigned NOT NULL default '1',
>   `marker` int(10) unsigned NOT NULL default '0',
>   `maxbytes` int(10) unsigned NOT NULL default '0',
>   `showreports` int(4) unsigned NOT NULL default '0',
>   `visible` int(1) unsigned NOT NULL default '1',
>   `hiddensections` int(2) unsigned NOT NULL default '0',
>   `groupmode` int(4) unsigned NOT NULL default '0',
>   `groupmodeforce` int(4) unsigned NOT NULL default '0',
729,734c726,731
<   `currency` varchar(3) collate utf8_unicode_ci NOT NULL default 'USD',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `metacourse` tinyint(1) unsigned NOT NULL default '0',
<   `requested` tinyint(1) unsigned NOT NULL default '0',
<   `restrictmodules` tinyint(1) unsigned NOT NULL default '0',
---
>   `currency` char(3) collate utf8_unicode_ci NOT NULL default 'USD',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `metacourse` int(1) unsigned NOT NULL default '0',
>   `requested` int(1) unsigned NOT NULL default '0',
>   `restrictmodules` int(1) unsigned NOT NULL default '0',
736c733
<   `expirythreshold` bigint(10) unsigned NOT NULL default '0',
---
>   `expirythreshold` int(10) unsigned NOT NULL default '0',
739,740c736,737
<   `enrolstartdate` bigint(10) unsigned NOT NULL default '0',
<   `enrolenddate` bigint(10) unsigned NOT NULL default '0',
---
>   `enrolstartdate` int(10) unsigned NOT NULL default '0',
>   `enrolenddate` int(10) unsigned NOT NULL default '0',
742c739
<   `defaultrole` bigint(10) unsigned NOT NULL default '0',
---
>   `defaultrole` int(10) unsigned NOT NULL default '0',
744,747c741,744
<   KEY `mdl_cour_cat_ix` (`category`),
<   KEY `mdl_cour_idn_ix` (`idnumber`),
<   KEY `mdl_cour_sho_ix` (`shortname`)
< ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Central course table';
---
>   KEY `category` (`category`),
>   KEY `idnumber` (`idnumber`),
>   KEY `shortname` (`shortname`)
> ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
765,771c762,768
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
<   `module` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_courallomodu_cou_ix` (`course`),
<   KEY `mdl_courallomodu_mod_ix` (`module`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='allowed modules foreach course';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
>   `module` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   KEY `course` (`course`),
>   KEY `module` (`module`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
788c785
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
791,793c788,790
<   `parent` bigint(10) unsigned NOT NULL default '0',
<   `sortorder` bigint(10) unsigned NOT NULL default '0',
<   `coursecount` bigint(10) unsigned NOT NULL default '0',
---
>   `parent` int(10) unsigned NOT NULL default '0',
>   `sortorder` int(10) unsigned NOT NULL default '0',
>   `coursecount` int(10) unsigned NOT NULL default '0',
795,796c792,793
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `depth` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `depth` int(10) unsigned NOT NULL default '0',
799c796
<   KEY `mdl_courcate_par_ix` (`parent`)
---
>   UNIQUE KEY `id` (`id`)
818,821c815,818
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `display` bigint(10) NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `display` int(10) NOT NULL default '0',
823c820,821
<   KEY `mdl_courdisp_couuse_ix` (`course`,`userid`)
---
>   UNIQUE KEY `id` (`id`),
>   KEY `courseuserid` (`course`,`userid`)
841,847c839,845
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `parent_course` bigint(10) unsigned NOT NULL default '0',
<   `child_course` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_courmeta_par_ix` (`parent_course`),
<   KEY `mdl_courmeta_chi_ix` (`child_course`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to store meta-courses relations';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `parent_course` int(10) NOT NULL default '0',
>   `child_course` int(10) NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   KEY `parent_course` (`parent_course`),
>   KEY `child_course` (`child_course`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
864,871c862,869
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
<   `module` bigint(10) unsigned NOT NULL default '0',
<   `instance` bigint(10) unsigned NOT NULL default '0',
<   `section` bigint(10) unsigned NOT NULL default '0',
<   `added` bigint(10) unsigned NOT NULL default '0',
<   `score` smallint(4) NOT NULL default '0',
<   `indent` mediumint(5) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
>   `module` int(10) unsigned NOT NULL default '0',
>   `instance` int(10) unsigned NOT NULL default '0',
>   `section` int(10) unsigned NOT NULL default '0',
>   `added` int(10) unsigned NOT NULL default '0',
>   `score` tinyint(4) NOT NULL default '0',
>   `indent` int(5) unsigned NOT NULL default '0',
874c872
<   `groupmode` smallint(4) NOT NULL default '0',
---
>   `groupmode` tinyint(4) NOT NULL default '0',
876,880c874,879
<   KEY `mdl_courmodu_vis_ix` (`visible`),
<   KEY `mdl_courmodu_cou_ix` (`course`),
<   KEY `mdl_courmodu_mod_ix` (`module`),
<   KEY `mdl_courmodu_ins_ix` (`instance`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='course_modules table retrofitted from MySQL';
---
>   UNIQUE KEY `id` (`id`),
>   KEY `visible` (`visible`),
>   KEY `course` (`course`),
>   KEY `module` (`module`),
>   KEY `instance` (`instance`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
897c896
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
902c901
<   `requester` bigint(10) NOT NULL default '0',
---
>   `requester` int(10) NOT NULL default '0',
905,906c904,905
<   KEY `mdl_courrequ_sho_ix` (`shortname`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='course requests';
---
>   KEY `shortname` (`shortname`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
923,926c922,924
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
<   `section` bigint(10) unsigned NOT NULL default '0',
<   `summary` text collate utf8_unicode_ci,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
>   `section` int(10) unsigned NOT NULL default '0',
927a926
>   `summary` text collate utf8_unicode_ci,
930,931c929,930
<   KEY `mdl_coursect_cousec_ix` (`course`,`section`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to define the sections for each course';
---
>   KEY `coursesection` (`course`,`section`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
948,949c947,948
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
952,956c951,955
<   `comments` smallint(4) unsigned NOT NULL default '0',
<   `timeavailablefrom` bigint(10) unsigned NOT NULL default '0',
<   `timeavailableto` bigint(10) unsigned NOT NULL default '0',
<   `timeviewfrom` bigint(10) unsigned NOT NULL default '0',
<   `timeviewto` bigint(10) unsigned NOT NULL default '0',
---
>   `comments` int(4) unsigned NOT NULL default '0',
>   `timeavailablefrom` int(10) unsigned NOT NULL default '0',
>   `timeavailableto` int(10) unsigned NOT NULL default '0',
>   `timeviewfrom` int(10) unsigned NOT NULL default '0',
>   `timeviewto` int(10) unsigned NOT NULL default '0',
960c959
<   `rssarticles` smallint(4) unsigned NOT NULL default '0',
---
>   `rssarticles` int(4) unsigned NOT NULL default '0',
970,975c969,974
<   `approval` smallint(4) unsigned NOT NULL default '0',
<   `scale` bigint(10) NOT NULL default '0',
<   `assessed` bigint(10) unsigned NOT NULL default '0',
<   `defaultsort` bigint(10) unsigned NOT NULL default '0',
<   `defaultsortdir` smallint(4) unsigned NOT NULL default '0',
<   `editany` smallint(4) unsigned NOT NULL default '0',
---
>   `approval` tinyint(4) unsigned NOT NULL default '0',
>   `scale` int(10) NOT NULL default '0',
>   `assessed` int(10) unsigned NOT NULL default '0',
>   `defaultsort` int(10) unsigned NOT NULL default '0',
>   `defaultsortdir` tinyint(4) unsigned NOT NULL default '0',
>   `editany` tinyint(4) unsigned NOT NULL default '0',
977c976
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Removed ratings column';
---
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Defines settings for each Database activity';
994,996c993,995
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `recordid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `recordid` int(10) unsigned NOT NULL default '0',
998,1002c997,1000
<   `created` bigint(10) unsigned NOT NULL default '0',
<   `modified` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_datacomm_rec_ix` (`recordid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to comment data records';
---
>   `created` int(10) unsigned NOT NULL default '0',
>   `modified` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1019,1021c1017,1019
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `fieldid` bigint(10) unsigned NOT NULL default '0',
<   `recordid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `fieldid` int(10) unsigned NOT NULL default '0',
>   `recordid` int(10) unsigned NOT NULL default '0',
1027,1030c1025,1026
<   PRIMARY KEY  (`id`),
<   KEY `mdl_datacont_rec_ix` (`recordid`),
<   KEY `mdl_datacont_fie_ix` (`fieldid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='the content introduced in each record/fields';
---
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1047,1048c1043,1044
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `dataid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `dataid` int(10) unsigned NOT NULL default '0',
1062,1064c1058,1059
<   PRIMARY KEY  (`id`),
<   KEY `mdl_datafiel_dat_ix` (`dataid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='every field available';
---
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1081,1087c1076,1081
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `recordid` bigint(10) unsigned NOT NULL default '0',
<   `rating` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_datarati_rec_ix` (`recordid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to rate data records';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `recordid` int(10) unsigned NOT NULL default '0',
>   `rating` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1104,1113c1098,1106
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `groupid` bigint(10) unsigned NOT NULL default '0',
<   `dataid` bigint(10) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `approved` smallint(4) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_datareco_dat_ix` (`dataid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='every record introduced';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `groupid` int(10) unsigned NOT NULL default '0',
>   `dataid` int(10) unsigned NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `approved` tinyint(4) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1130c1123
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
1134,1139c1127,1132
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `transid` bigint(10) unsigned NOT NULL default '0',
<   `status` bigint(10) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `settletime` bigint(10) unsigned NOT NULL default '0',
---
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `transid` int(10) unsigned NOT NULL default '0',
>   `status` int(10) unsigned NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `settletime` int(10) unsigned NOT NULL default '0',
1143,1146c1136,1139
<   KEY `mdl_enroauth_cou_ix` (`courseid`),
<   KEY `mdl_enroauth_use_ix` (`userid`),
<   KEY `mdl_enroauth_sta_ix` (`status`),
<   KEY `mdl_enroauth_tra_ix` (`transid`)
---
>   KEY `courseid` (`courseid`),
>   KEY `userid` (`userid`),
>   KEY `status` (`status`),
>   KEY `transid` (`transid`)
1164,1166c1157,1159
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `orderid` bigint(10) unsigned NOT NULL default '0',
<   `status` tinyint(1) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `orderid` int(10) unsigned NOT NULL default '0',
>   `status` int(1) unsigned NOT NULL default '0',
1168,1169c1161,1162
<   `transid` bigint(10) unsigned default '0',
<   `settletime` bigint(10) unsigned NOT NULL default '0',
---
>   `transid` int(10) unsigned default '0',
>   `settletime` int(10) unsigned NOT NULL default '0',
1171,1172c1164,1165
<   KEY `mdl_enroauthrefu_tra_ix` (`transid`),
<   KEY `mdl_enroauthrefu_ord_ix` (`orderid`)
---
>   KEY `orderid` (`orderid`),
>   KEY `transid` (`transid`)
1190c1183
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
1195,1196c1188,1189
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
1209c1202
<   `timeupdated` bigint(10) unsigned NOT NULL default '0',
---
>   `timeupdated` int(10) unsigned NOT NULL default '0',
1228c1221
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
1231,1235c1224,1228
<   `format` smallint(4) unsigned NOT NULL default '0',
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `groupid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `repeatid` bigint(10) unsigned NOT NULL default '0',
---
>   `format` int(4) unsigned NOT NULL default '0',
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `groupid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `repeatid` int(10) unsigned NOT NULL default '0',
1237c1230
<   `instance` bigint(10) unsigned NOT NULL default '0',
---
>   `instance` int(10) unsigned NOT NULL default '0',
1239,1249c1232,1243
<   `timestart` bigint(10) unsigned NOT NULL default '0',
<   `timeduration` bigint(10) unsigned NOT NULL default '0',
<   `visible` smallint(4) NOT NULL default '1',
<   `uuid` varchar(36) collate utf8_unicode_ci NOT NULL default '',
<   `sequence` bigint(10) unsigned NOT NULL default '1',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_even_cou_ix` (`courseid`),
<   KEY `mdl_even_use_ix` (`userid`),
<   KEY `mdl_even_tim_ix` (`timestart`),
<   KEY `mdl_even_tim2_ix` (`timeduration`)
---
>   `timestart` int(10) unsigned NOT NULL default '0',
>   `timeduration` int(10) unsigned NOT NULL default '0',
>   `visible` tinyint(4) NOT NULL default '1',
>   `uuid` char(36) collate utf8_unicode_ci NOT NULL default '',
>   `sequence` int(10) unsigned NOT NULL default '1',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `id` (`id`),
>   KEY `courseid` (`courseid`),
>   KEY `userid` (`userid`),
>   KEY `timestart` (`timestart`),
>   KEY `timeduration` (`timeduration`)
1267,1268c1261,1262
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
1270,1282c1264,1276
<   `nelements` smallint(3) unsigned NOT NULL default '1',
<   `phase` smallint(3) unsigned NOT NULL default '0',
<   `gradingstrategy` smallint(3) unsigned NOT NULL default '1',
<   `usemaximum` smallint(3) unsigned NOT NULL default '0',
<   `assessmentcomps` smallint(3) unsigned NOT NULL default '2',
<   `anonymous` smallint(3) unsigned NOT NULL default '1',
<   `maxbytes` bigint(10) unsigned NOT NULL default '100000',
<   `deadline` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `grade` smallint(3) NOT NULL default '0',
<   `gradinggrade` smallint(3) NOT NULL default '0',
<   `showleaguetable` smallint(3) unsigned NOT NULL default '0',
<   `usepassword` smallint(3) unsigned NOT NULL default '0',
---
>   `nelements` tinyint(3) unsigned NOT NULL default '1',
>   `phase` tinyint(3) unsigned NOT NULL default '0',
>   `gradingstrategy` tinyint(3) unsigned NOT NULL default '1',
>   `usemaximum` tinyint(3) unsigned NOT NULL default '0',
>   `assessmentcomps` tinyint(3) unsigned NOT NULL default '2',
>   `anonymous` tinyint(3) unsigned NOT NULL default '1',
>   `maxbytes` int(10) unsigned NOT NULL default '100000',
>   `deadline` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `grade` tinyint(3) NOT NULL default '0',
>   `gradinggrade` tinyint(3) NOT NULL default '0',
>   `showleaguetable` tinyint(3) unsigned NOT NULL default '0',
>   `usepassword` tinyint(3) unsigned NOT NULL default '0',
1285c1279
<   KEY `mdl_exer_cou_ix` (`course`)
---
>   KEY `course` (`course`)
1303,1310c1297,1304
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `exerciseid` bigint(10) unsigned NOT NULL default '0',
<   `submissionid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timegraded` bigint(10) unsigned NOT NULL default '0',
<   `grade` double NOT NULL default '0',
<   `gradinggrade` smallint(3) NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `exerciseid` int(10) unsigned NOT NULL default '0',
>   `submissionid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timegraded` int(10) unsigned NOT NULL default '0',
>   `grade` float NOT NULL default '0',
>   `gradinggrade` int(3) NOT NULL default '0',
1315,1317c1309,1311
<   KEY `mdl_exerasse_use_ix` (`userid`),
<   KEY `mdl_exerasse_exe_ix` (`exerciseid`),
<   KEY `mdl_exerasse_sub_ix` (`submissionid`)
---
>   KEY `submissionid` (`submissionid`),
>   KEY `userid` (`userid`),
>   KEY `exerciseid` (`exerciseid`)
1335,1337c1329,1331
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `exerciseid` bigint(10) unsigned NOT NULL default '0',
<   `elementno` smallint(3) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `exerciseid` int(10) unsigned NOT NULL default '0',
>   `elementno` tinyint(3) unsigned NOT NULL default '0',
1339,1341c1333,1335
<   `scale` smallint(3) unsigned NOT NULL default '0',
<   `maxscore` smallint(3) unsigned NOT NULL default '1',
<   `weight` smallint(3) unsigned NOT NULL default '11',
---
>   `scale` tinyint(3) unsigned NOT NULL default '0',
>   `maxscore` tinyint(3) unsigned NOT NULL default '1',
>   `weight` tinyint(3) unsigned NOT NULL default '11',
1343c1337
<   KEY `mdl_exerelem_exe_ix` (`exerciseid`)
---
>   KEY `exerciseid` (`exerciseid`)
1361,1364c1355,1358
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `exerciseid` bigint(10) unsigned NOT NULL default '0',
<   `assessmentid` bigint(10) unsigned NOT NULL default '0',
<   `elementno` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `exerciseid` int(10) unsigned NOT NULL default '0',
>   `assessmentid` int(10) unsigned NOT NULL default '0',
>   `elementno` int(10) unsigned NOT NULL default '0',
1366c1360
<   `grade` smallint(3) NOT NULL default '0',
---
>   `grade` tinyint(3) NOT NULL default '0',
1368,1369c1362,1363
<   KEY `mdl_exergrad_exe_ix` (`exerciseid`),
<   KEY `mdl_exergrad_ass_ix` (`assessmentid`)
---
>   KEY `assessmentid` (`assessmentid`),
>   KEY `exerciseid` (`exerciseid`)
1387,1390c1381,1384
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `exerciseid` bigint(10) unsigned NOT NULL default '0',
<   `elementno` bigint(10) unsigned NOT NULL default '0',
<   `rubricno` smallint(3) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `exerciseid` int(10) unsigned NOT NULL default '0',
>   `elementno` int(10) unsigned NOT NULL default '0',
>   `rubricno` tinyint(3) unsigned NOT NULL default '0',
1393c1387
<   KEY `mdl_exerrubr_exe_ix` (`exerciseid`)
---
>   KEY `exerciseid` (`exerciseid`)
1411,1413c1405,1407
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `exerciseid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `exerciseid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
1415,1419c1409,1413
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `resubmit` smallint(3) unsigned NOT NULL default '0',
<   `mailed` smallint(3) unsigned NOT NULL default '0',
<   `isexercise` smallint(3) unsigned NOT NULL default '0',
<   `late` smallint(3) unsigned NOT NULL default '0',
---
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `resubmit` tinyint(3) unsigned NOT NULL default '0',
>   `mailed` tinyint(3) unsigned NOT NULL default '0',
>   `isexercise` tinyint(3) unsigned NOT NULL default '0',
>   `late` tinyint(3) unsigned NOT NULL default '0',
1421,1422c1415,1416
<   KEY `mdl_exersubm_use_ix` (`userid`),
<   KEY `mdl_exersubm_exe_ix` (`exerciseid`)
---
>   KEY `userid` (`userid`),
>   KEY `exerciseid` (`exerciseid`)
1440,1441c1434,1435
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
1445,1449c1439,1443
<   `assessed` bigint(10) unsigned NOT NULL default '0',
<   `assesstimestart` bigint(10) unsigned NOT NULL default '0',
<   `assesstimefinish` bigint(10) unsigned NOT NULL default '0',
<   `scale` bigint(10) NOT NULL default '0',
<   `maxbytes` bigint(10) unsigned NOT NULL default '0',
---
>   `assessed` int(10) unsigned NOT NULL default '0',
>   `assesstimestart` int(10) unsigned NOT NULL default '0',
>   `assesstimefinish` int(10) unsigned NOT NULL default '0',
>   `scale` int(10) NOT NULL default '0',
>   `maxbytes` int(10) unsigned NOT NULL default '0',
1454,1457c1448,1451
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `warnafter` bigint(10) unsigned NOT NULL default '0',
<   `blockafter` bigint(10) unsigned NOT NULL default '0',
<   `blockperiod` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `warnafter` int(10) unsigned NOT NULL default '0',
>   `blockafter` int(10) unsigned NOT NULL default '0',
>   `blockperiod` int(10) unsigned NOT NULL default '0',
1459c1453,1454
<   KEY `mdl_foru_cou_ix` (`course`)
---
>   UNIQUE KEY `id` (`id`),
>   KEY `course` (`course`)
1477,1479c1472,1474
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
<   `forum` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
>   `forum` int(10) unsigned NOT NULL default '0',
1481,1483c1476,1478
<   `firstpost` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `groupid` bigint(10) NOT NULL default '-1',
---
>   `firstpost` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `groupid` int(10) NOT NULL default '-1',
1485,1488c1480,1483
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `usermodified` bigint(10) unsigned NOT NULL default '0',
<   `timestart` bigint(10) unsigned NOT NULL default '0',
<   `timeend` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `usermodified` int(10) unsigned NOT NULL default '0',
>   `timestart` int(10) unsigned NOT NULL default '0',
>   `timeend` int(10) unsigned NOT NULL default '0',
1490,1491c1485,1486
<   KEY `mdl_forudisc_use_ix` (`userid`),
<   KEY `mdl_forudisc_for_ix` (`forum`)
---
>   KEY `mdl_forum_discussions_forum_idx` (`forum`),
>   KEY `mdl_forum_discussions_userid_idx` (`userid`)
1509,1514c1504,1509
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `discussion` bigint(10) unsigned NOT NULL default '0',
<   `parent` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `created` bigint(10) unsigned NOT NULL default '0',
<   `modified` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `discussion` int(10) unsigned NOT NULL default '0',
>   `parent` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `created` int(10) unsigned NOT NULL default '0',
>   `modified` int(10) unsigned NOT NULL default '0',
1520,1521c1515,1516
<   `totalscore` smallint(4) NOT NULL default '0',
<   `mailnow` bigint(10) unsigned NOT NULL default '0',
---
>   `totalscore` tinyint(4) NOT NULL default '0',
>   `mailnow` int(10) unsigned NOT NULL default '0',
1523,1527c1518,1522
<   KEY `mdl_forupost_use_ix` (`userid`),
<   KEY `mdl_forupost_cre_ix` (`created`),
<   KEY `mdl_forupost_mai_ix` (`mailed`),
<   KEY `mdl_forupost_dis_ix` (`discussion`),
<   KEY `mdl_forupost_par_ix` (`parent`)
---
>   KEY `mdl_forum_posts_parent_idx` (`parent`),
>   KEY `mdl_forum_posts_discussion_idx` (`discussion`),
>   KEY `mdl_forum_posts_userid_idx` (`userid`),
>   KEY `mdl_forum_posts_created_idx` (`created`),
>   KEY `mdl_forum_posts_mailed_idx` (`mailed`)
1545,1548c1540,1543
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `discussionid` bigint(10) unsigned NOT NULL default '0',
<   `postid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `discussionid` int(10) unsigned NOT NULL default '0',
>   `postid` int(10) unsigned NOT NULL default '0',
1550,1552c1545,1546
<   KEY `mdl_foruqueu_use_ix` (`userid`),
<   KEY `mdl_foruqueu_dis_ix` (`discussionid`),
<   KEY `mdl_foruqueu_pos_ix` (`postid`)
---
>   KEY `user` (`userid`),
>   KEY `post` (`postid`)
1570,1578c1564,1572
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `post` bigint(10) unsigned NOT NULL default '0',
<   `time` bigint(10) unsigned NOT NULL default '0',
<   `rating` smallint(4) NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_forurati_use_ix` (`userid`),
<   KEY `mdl_forurati_pos_ix` (`post`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='forum_ratings table retrofitted from MySQL';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `post` int(10) unsigned NOT NULL default '0',
>   `time` int(10) unsigned NOT NULL default '0',
>   `rating` tinyint(4) NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   KEY `userid` (`userid`),
>   KEY `post` (`post`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Contains user ratings for individual posts';
1595,1605c1589,1599
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `forumid` bigint(10) unsigned NOT NULL default '0',
<   `discussionid` bigint(10) unsigned NOT NULL default '0',
<   `postid` bigint(10) unsigned NOT NULL default '0',
<   `firstread` bigint(10) unsigned NOT NULL default '0',
<   `lastread` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_foruread_usefor_ix` (`userid`,`forumid`),
<   KEY `mdl_foruread_usedis_ix` (`userid`,`discussionid`),
<   KEY `mdl_foruread_usepos_ix` (`userid`,`postid`)
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) NOT NULL default '0',
>   `forumid` int(10) NOT NULL default '0',
>   `discussionid` int(10) NOT NULL default '0',
>   `postid` int(10) NOT NULL default '0',
>   `firstread` int(10) NOT NULL default '0',
>   `lastread` int(10) NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   KEY `mdl_forum_user_forum_idx` (`userid`,`forumid`),
>   KEY `mdl_forum_user_discussion_idx` (`userid`,`discussionid`),
>   KEY `mdl_forum_user_post_idx` (`userid`,`postid`)
1623,1628c1617,1623
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `forum` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_forusubs_use_ix` (`userid`),
<   KEY `mdl_forusubs_for_ix` (`forum`)
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `forum` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `id` (`id`),
>   KEY `userid` (`userid`),
>   KEY `forum` (`forum`)
1646,1648c1641,1643
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `forumid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) NOT NULL default '0',
>   `forumid` int(10) NOT NULL default '0',
1650,1651c1645,1646
<   KEY `mdl_forutracpref_usefor_ix` (`userid`,`forumid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tracks each users untracked forums';
---
>   KEY `user_forum_idx` (`userid`,`forumid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tracks each users untracked forums.';
1668,1669c1663,1664
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
1684c1679
<   `entbypage` smallint(3) unsigned NOT NULL default '10',
---
>   `entbypage` tinyint(3) unsigned NOT NULL default '10',
1688,1693c1683,1688
<   `assessed` bigint(10) unsigned NOT NULL default '0',
<   `assesstimestart` bigint(10) unsigned NOT NULL default '0',
<   `assesstimefinish` bigint(10) unsigned NOT NULL default '0',
<   `scale` bigint(10) NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `assessed` int(10) unsigned NOT NULL default '0',
>   `assesstimestart` int(10) unsigned NOT NULL default '0',
>   `assesstimefinish` int(10) unsigned NOT NULL default '0',
>   `scale` int(10) NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
1695c1690
<   KEY `mdl_glos_cou_ix` (`course`)
---
>   KEY `course` (`course`)
1713,1714c1708,1709
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `entryid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `entryid` int(10) unsigned NOT NULL default '0',
1717c1712
<   KEY `mdl_glosalia_ent_ix` (`entryid`)
---
>   KEY `entryid` (`entryid`)
1735,1736c1730,1731
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `glossaryid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `glossaryid` int(10) unsigned NOT NULL default '0',
1740c1735
<   KEY `mdl_gloscate_glo_ix` (`glossaryid`)
---
>   KEY `glossaryid` (`glossaryid`)
1758,1760c1753,1755
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `entryid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `entryid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
1763c1758
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
1765,1766c1760,1761
<   KEY `mdl_gloscomm_use_ix` (`userid`),
<   KEY `mdl_gloscomm_ent_ix` (`entryid`)
---
>   KEY `userid` (`userid`),
>   KEY `entryid` (`entryid`)
1784,1786c1779,1781
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `glossaryid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `glossaryid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
1791,1792c1786,1787
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
1794c1789
<   `sourceglossaryid` bigint(10) unsigned NOT NULL default '0',
---
>   `sourceglossaryid` int(10) unsigned NOT NULL default '0',
1800,1802c1795,1797
<   KEY `mdl_glosentr_use_ix` (`userid`),
<   KEY `mdl_glosentr_con_ix` (`concept`),
<   KEY `mdl_glosentr_glo_ix` (`glossaryid`)
---
>   KEY `glossaryid` (`glossaryid`),
>   KEY `userid` (`userid`),
>   KEY `concept` (`concept`)
1820,1822c1815,1817
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `categoryid` bigint(10) unsigned NOT NULL default '0',
<   `entryid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `categoryid` int(10) unsigned NOT NULL default '0',
>   `entryid` int(10) unsigned NOT NULL default '0',
1824,1825c1819,1820
<   KEY `mdl_glosentrcate_cat_ix` (`categoryid`),
<   KEY `mdl_glosentrcate_ent_ix` (`entryid`)
---
>   KEY `entryid` (`entryid`),
>   KEY `categoryid` (`categoryid`)
1843c1838
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
1870,1874c1865,1869
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `entryid` bigint(10) unsigned NOT NULL default '0',
<   `time` bigint(10) unsigned NOT NULL default '0',
<   `rating` smallint(4) NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `entryid` int(10) unsigned NOT NULL default '0',
>   `time` int(10) unsigned NOT NULL default '0',
>   `rating` tinyint(4) NOT NULL default '0',
1876,1877c1871,1872
<   KEY `mdl_glosrati_use_ix` (`userid`),
<   KEY `mdl_glosrati_ent_ix` (`entryid`)
---
>   KEY `userid` (`userid`),
>   KEY `entryid` (`entryid`)
1895c1890
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
1897,1900c1892,1895
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `drop_x_lowest` bigint(10) unsigned NOT NULL default '0',
<   `bonus_points` bigint(10) unsigned NOT NULL default '0',
<   `hidden` bigint(10) unsigned NOT NULL default '0',
---
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `drop_x_lowest` int(10) unsigned NOT NULL default '0',
>   `bonus_points` int(10) unsigned NOT NULL default '0',
>   `hidden` int(10) unsigned NOT NULL default '0',
1903,1904c1898,1899
<   KEY `mdl_gradcate_cou_ix` (`courseid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to define categories to group activity grades';
---
>   KEY `courseid` (`courseid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1921,1924c1916,1919
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `grade_itemid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `grade_itemid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
1926,1927c1921,1922
<   KEY `mdl_gradexce_cou_ix` (`courseid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='individual grades to be skipped for certain students';
---
>   KEY `courseid` (`courseid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1944,1951c1939,1946
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `category` bigint(10) unsigned NOT NULL default '0',
<   `modid` bigint(10) unsigned NOT NULL default '0',
<   `cminstance` bigint(10) unsigned NOT NULL default '0',
<   `scale_grade` double(11,10) NOT NULL default '1.0000000000',
<   `extra_credit` bigint(10) unsigned NOT NULL default '0',
<   `sort_order` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `category` int(10) unsigned NOT NULL default '0',
>   `modid` int(10) unsigned NOT NULL default '0',
>   `cminstance` int(10) unsigned NOT NULL default '0',
>   `scale_grade` float(11,10) NOT NULL default '1.0000000000',
>   `extra_credit` int(10) unsigned NOT NULL default '0',
>   `sort_order` int(10) unsigned NOT NULL default '0',
1953,1954c1948,1949
<   KEY `mdl_graditem_cou_ix` (`courseid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='items to be graded';
---
>   KEY `courseid` (`courseid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1971,1972c1966,1967
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
1977,1978c1972,1973
<   KEY `mdl_gradlett_cou_ix` (`courseid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to convert numerical grades to letter grades';
---
>   KEY `courseid` (`courseid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1995,1998c1990,1993
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `preference` bigint(10) NOT NULL default '0',
<   `value` bigint(10) NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `preference` int(10) NOT NULL default '0',
>   `value` int(10) NOT NULL default '0',
2000,2001c1995,1996
<   UNIQUE KEY `mdl_gradpref_coupre_uix` (`courseid`,`preference`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Preferences of the gradebook for each course';
---
>   UNIQUE KEY `courseidpreference` (`courseid`,`preference`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2018,2019c2013,2014
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
2025,2031c2020,2027
<   `picture` bigint(10) unsigned NOT NULL default '0',
<   `hidepicture` tinyint(2) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_grou_cou_ix` (`courseid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Each record is a group in a course';
---
>   `picture` int(10) unsigned NOT NULL default '0',
>   `hidepicture` int(2) unsigned NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `id` (`id`),
>   KEY `courseid` (`courseid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Each record is a group in a course.';
2048,2054c2044,2051
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `groupid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `timeadded` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_groumemb_gro_ix` (`groupid`),
<   KEY `mdl_groumemb_use_ix` (`userid`)
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `groupid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `timeadded` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `id` (`id`),
>   KEY `groupid` (`groupid`),
>   KEY `userid` (`userid`)
2072,2073c2069,2070
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
2076,2078c2073,2075
<   `timeopen` bigint(10) unsigned NOT NULL default '0',
<   `timeclose` bigint(10) unsigned NOT NULL default '0',
<   `location` smallint(4) unsigned NOT NULL default '0',
---
>   `timeopen` int(10) unsigned NOT NULL default '0',
>   `timeclose` int(10) unsigned NOT NULL default '0',
>   `location` int(4) unsigned NOT NULL default '0',
2080,2082c2077,2079
<   `outputformat` smallint(4) unsigned NOT NULL default '1',
<   `navigation` smallint(4) unsigned NOT NULL default '1',
<   `studentfeedback` smallint(4) unsigned NOT NULL default '0',
---
>   `outputformat` int(4) unsigned NOT NULL default '1',
>   `navigation` int(4) unsigned NOT NULL default '1',
>   `studentfeedback` tinyint(4) unsigned NOT NULL default '0',
2084,2089c2081,2086
<   `forceplugins` smallint(4) unsigned NOT NULL default '0',
<   `shownextquiz` smallint(4) unsigned NOT NULL default '0',
<   `review` smallint(4) NOT NULL default '0',
<   `grade` bigint(10) NOT NULL default '0',
<   `grademethod` smallint(4) NOT NULL default '1',
<   `attempts` mediumint(6) NOT NULL default '0',
---
>   `forceplugins` int(4) unsigned NOT NULL default '0',
>   `shownextquiz` int(4) unsigned NOT NULL default '0',
>   `review` tinyint(4) NOT NULL default '0',
>   `grade` int(10) NOT NULL default '0',
>   `grademethod` tinyint(4) NOT NULL default '1',
>   `attempts` smallint(6) NOT NULL default '0',
2092,2094c2089,2091
<   `clickreporting` smallint(4) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `clickreporting` tinyint(4) unsigned NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
2113,2124c2110,2121
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `hotpot` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `starttime` bigint(10) unsigned NOT NULL default '0',
<   `endtime` bigint(10) unsigned NOT NULL default '0',
<   `score` mediumint(6) unsigned NOT NULL default '0',
<   `penalties` mediumint(6) unsigned NOT NULL default '0',
<   `attempt` mediumint(6) unsigned NOT NULL default '0',
<   `timestart` bigint(10) unsigned NOT NULL default '0',
<   `timefinish` bigint(10) unsigned NOT NULL default '0',
<   `status` smallint(4) unsigned NOT NULL default '1',
<   `clickreportid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `hotpot` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `starttime` int(10) unsigned NOT NULL default '0',
>   `endtime` int(10) unsigned NOT NULL default '0',
>   `score` int(6) unsigned NOT NULL default '0',
>   `penalties` int(6) unsigned NOT NULL default '0',
>   `attempt` int(6) unsigned NOT NULL default '0',
>   `timestart` int(10) unsigned NOT NULL default '0',
>   `timefinish` int(10) unsigned NOT NULL default '0',
>   `status` tinyint(4) unsigned NOT NULL default '1',
>   `clickreportid` int(10) unsigned NOT NULL default '0',
2126,2127c2123,2124
<   KEY `mdl_hotpatte_use_ix` (`userid`),
<   KEY `mdl_hotpatte_hot_ix` (`hotpot`)
---
>   KEY `hotpot_attempts_hotpot_idx` (`hotpot`),
>   KEY `hotpot_attempts_userid_idx` (`userid`)
2145,2146c2142,2143
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `attempt` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `attempt` int(10) unsigned NOT NULL default '0',
2149c2146
<   KEY `mdl_hotpdeta_att_ix` (`attempt`)
---
>   KEY `hotpot_details_attempt_idx` (`attempt`)
2167c2164
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
2169,2171c2166,2168
<   `type` smallint(4) unsigned NOT NULL default '0',
<   `text` bigint(10) unsigned NOT NULL default '0',
<   `hotpot` bigint(10) unsigned NOT NULL default '0',
---
>   `type` tinyint(4) unsigned NOT NULL default '0',
>   `text` int(10) unsigned NOT NULL default '0',
>   `hotpot` int(10) unsigned NOT NULL default '0',
2174,2175c2171,2172
<   KEY `mdl_hotpques_md5_ix` (`md5key`),
<   KEY `mdl_hotpques_hot_ix` (`hotpot`)
---
>   KEY `hotpot_questions_hotpot_idx` (`hotpot`),
>   KEY `hotpot_questions_md5key_idx` (`md5key`)
2193,2197c2190,2194
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `attempt` bigint(10) unsigned NOT NULL default '0',
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `score` mediumint(6) NOT NULL default '0',
<   `weighting` mediumint(6) NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `attempt` int(10) unsigned NOT NULL default '0',
>   `question` int(10) unsigned NOT NULL default '0',
>   `score` smallint(6) NOT NULL default '0',
>   `weighting` smallint(6) NOT NULL default '0',
2201,2203c2198,2200
<   `hints` mediumint(6) unsigned NOT NULL default '0',
<   `clues` mediumint(6) unsigned NOT NULL default '0',
<   `checks` mediumint(6) unsigned NOT NULL default '0',
---
>   `hints` smallint(6) unsigned NOT NULL default '0',
>   `clues` smallint(6) unsigned NOT NULL default '0',
>   `checks` smallint(6) unsigned NOT NULL default '0',
2205,2206c2202,2203
<   KEY `mdl_hotpresp_att_ix` (`attempt`),
<   KEY `mdl_hotpresp_que_ix` (`question`)
---
>   KEY `hotpot_responses_attempt_idx` (`attempt`),
>   KEY `hotpot_responses_question_idx` (`question`)
2224c2221
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
2228c2225
<   KEY `mdl_hotpstri_md5_ix` (`md5key`)
---
>   KEY `hotpot_strings_md5key_idx` (`md5key`)
2246,2247c2243,2244
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
2251,2253c2248,2250
<   `days` mediumint(5) unsigned NOT NULL default '7',
<   `assessed` bigint(10) NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `days` smallint(5) unsigned NOT NULL default '7',
>   `assessed` int(10) NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
2255,2256c2252,2253
<   KEY `mdl_jour_cou_ix` (`course`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='data for each journal';
---
>   KEY `course` (`course`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2273,2276c2270,2273
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `journal` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `modified` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `journal` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `modified` int(10) unsigned NOT NULL default '0',
2279c2276
<   `rating` bigint(10) default '0',
---
>   `rating` int(10) default '0',
2281,2283c2278,2280
<   `teacher` bigint(10) unsigned NOT NULL default '0',
<   `timemarked` bigint(10) unsigned NOT NULL default '0',
<   `mailed` tinyint(1) unsigned NOT NULL default '0',
---
>   `teacher` int(10) unsigned NOT NULL default '0',
>   `timemarked` int(10) unsigned NOT NULL default '0',
>   `mailed` int(1) unsigned NOT NULL default '0',
2285,2286c2282,2283
<   KEY `mdl_jourentr_use_ix` (`userid`),
<   KEY `mdl_jourentr_jou_ix` (`journal`)
---
>   KEY `journal` (`journal`),
>   KEY `userid` (`userid`)
2304,2305c2301,2302
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
2308c2305
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
2310c2307
<   KEY `mdl_labe_cou_ix` (`course`)
---
>   KEY `course` (`course`)
2328,2329c2325,2326
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
2333c2330
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
2335c2332
<   KEY `mdl_lams_cou_ix` (`course`)
---
>   KEY `course` (`course`)
2353,2354c2350,2351
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
2356,2358c2353,2355
<   `practice` smallint(3) unsigned NOT NULL default '0',
<   `modattempts` smallint(3) unsigned NOT NULL default '0',
<   `usepassword` smallint(3) unsigned NOT NULL default '0',
---
>   `practice` tinyint(3) unsigned NOT NULL default '0',
>   `modattempts` tinyint(3) unsigned NOT NULL default '0',
>   `usepassword` tinyint(3) unsigned NOT NULL default '0',
2360c2357
<   `dependency` bigint(10) unsigned NOT NULL default '0',
---
>   `dependency` int(10) unsigned NOT NULL default '0',
2362,2376c2359,2373
<   `grade` smallint(3) NOT NULL default '0',
<   `custom` smallint(3) unsigned NOT NULL default '0',
<   `ongoing` smallint(3) unsigned NOT NULL default '0',
<   `usemaxgrade` smallint(3) NOT NULL default '0',
<   `maxanswers` smallint(3) unsigned NOT NULL default '4',
<   `maxattempts` smallint(3) unsigned NOT NULL default '5',
<   `review` smallint(3) unsigned NOT NULL default '0',
<   `nextpagedefault` smallint(3) unsigned NOT NULL default '0',
<   `feedback` smallint(3) unsigned NOT NULL default '1',
<   `minquestions` smallint(3) unsigned NOT NULL default '0',
<   `maxpages` smallint(3) unsigned NOT NULL default '0',
<   `timed` smallint(3) unsigned NOT NULL default '0',
<   `maxtime` bigint(10) unsigned NOT NULL default '0',
<   `retake` smallint(3) unsigned NOT NULL default '1',
<   `activitylink` bigint(10) unsigned NOT NULL default '0',
---
>   `grade` tinyint(3) NOT NULL default '0',
>   `custom` tinyint(3) unsigned NOT NULL default '0',
>   `ongoing` tinyint(3) unsigned NOT NULL default '0',
>   `usemaxgrade` tinyint(3) NOT NULL default '0',
>   `maxanswers` int(3) unsigned NOT NULL default '4',
>   `maxattempts` int(3) unsigned NOT NULL default '5',
>   `review` tinyint(3) unsigned NOT NULL default '0',
>   `nextpagedefault` int(3) unsigned NOT NULL default '0',
>   `feedback` int(10) unsigned NOT NULL default '1',
>   `minquestions` int(3) unsigned NOT NULL default '0',
>   `maxpages` int(3) unsigned NOT NULL default '0',
>   `timed` tinyint(3) unsigned NOT NULL default '0',
>   `maxtime` int(10) unsigned NOT NULL default '0',
>   `retake` int(3) unsigned NOT NULL default '1',
>   `activitylink` int(10) unsigned NOT NULL default '0',
2378,2392c2375,2389
<   `mediaheight` bigint(10) unsigned NOT NULL default '100',
<   `mediawidth` bigint(10) unsigned NOT NULL default '650',
<   `mediaclose` smallint(3) unsigned NOT NULL default '0',
<   `slideshow` smallint(3) unsigned NOT NULL default '0',
<   `width` bigint(10) unsigned NOT NULL default '640',
<   `height` bigint(10) unsigned NOT NULL default '480',
<   `bgcolor` varchar(7) collate utf8_unicode_ci NOT NULL default '#FFFFFF',
<   `displayleft` smallint(3) unsigned NOT NULL default '0',
<   `displayleftif` smallint(3) unsigned NOT NULL default '0',
<   `progressbar` smallint(3) unsigned NOT NULL default '0',
<   `highscores` smallint(3) unsigned NOT NULL default '0',
<   `maxhighscores` bigint(10) unsigned NOT NULL default '0',
<   `available` bigint(10) unsigned NOT NULL default '0',
<   `deadline` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `mediaheight` int(10) unsigned NOT NULL default '100',
>   `mediawidth` int(10) unsigned NOT NULL default '650',
>   `mediaclose` tinyint(3) unsigned NOT NULL default '0',
>   `slideshow` tinyint(3) unsigned NOT NULL default '0',
>   `width` int(10) unsigned NOT NULL default '640',
>   `height` int(10) unsigned NOT NULL default '480',
>   `bgcolor` char(7) collate utf8_unicode_ci NOT NULL default '#FFFFFF',
>   `displayleft` tinyint(3) unsigned NOT NULL default '0',
>   `displayleftif` int(3) unsigned NOT NULL default '0',
>   `progressbar` tinyint(3) unsigned NOT NULL default '0',
>   `highscores` tinyint(3) unsigned NOT NULL default '0',
>   `maxhighscores` int(10) unsigned NOT NULL default '0',
>   `available` int(10) unsigned NOT NULL default '0',
>   `deadline` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
2394c2391
<   KEY `mdl_less_cou_ix` (`course`)
---
>   KEY `course` (`course`)
2412,2420c2409,2417
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `lessonid` bigint(10) unsigned NOT NULL default '0',
<   `pageid` bigint(10) unsigned NOT NULL default '0',
<   `jumpto` bigint(11) NOT NULL default '0',
<   `grade` smallint(3) unsigned NOT NULL default '0',
<   `score` bigint(10) NOT NULL default '0',
<   `flags` smallint(3) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `lessonid` int(10) unsigned NOT NULL default '0',
>   `pageid` int(10) unsigned NOT NULL default '0',
>   `jumpto` int(11) NOT NULL default '0',
>   `grade` tinyint(3) unsigned NOT NULL default '0',
>   `score` int(10) NOT NULL default '0',
>   `flags` tinyint(3) unsigned NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
2424,2425c2421,2422
<   KEY `mdl_lessansw_les_ix` (`lessonid`),
<   KEY `mdl_lessansw_pag_ix` (`pageid`)
---
>   KEY `pageid` (`pageid`),
>   KEY `lessonid` (`lessonid`)
2443,2449c2440,2446
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `lessonid` bigint(10) unsigned NOT NULL default '0',
<   `pageid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `answerid` bigint(10) unsigned NOT NULL default '0',
<   `retry` smallint(3) unsigned NOT NULL default '0',
<   `correct` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `lessonid` int(10) unsigned NOT NULL default '0',
>   `pageid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `answerid` int(10) unsigned NOT NULL default '0',
>   `retry` int(3) unsigned NOT NULL default '0',
>   `correct` int(10) unsigned NOT NULL default '0',
2451c2448
<   `timeseen` bigint(10) unsigned NOT NULL default '0',
---
>   `timeseen` int(10) unsigned NOT NULL default '0',
2453,2456c2450,2452
<   KEY `mdl_lessatte_use_ix` (`userid`),
<   KEY `mdl_lessatte_les_ix` (`lessonid`),
<   KEY `mdl_lessatte_pag_ix` (`pageid`),
<   KEY `mdl_lessatte_ans_ix` (`answerid`)
---
>   KEY `userid` (`userid`),
>   KEY `lessonid` (`lessonid`),
>   KEY `pageid` (`pageid`)
2474,2485c2470,2478
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `lessonid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `pageid` bigint(10) unsigned NOT NULL default '0',
<   `retry` bigint(10) unsigned NOT NULL default '0',
<   `flag` smallint(3) unsigned NOT NULL default '0',
<   `timeseen` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_lessbran_use_ix` (`userid`),
<   KEY `mdl_lessbran_les_ix` (`lessonid`),
<   KEY `mdl_lessbran_pag_ix` (`pageid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='branches for each lesson/user';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `lessonid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `pageid` int(10) unsigned NOT NULL default '0',
>   `retry` int(10) unsigned NOT NULL default '0',
>   `flag` tinyint(3) unsigned NOT NULL default '0',
>   `timeseen` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2502,2506c2495,2499
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
<   `practice` smallint(3) unsigned NOT NULL default '0',
<   `modattempts` smallint(3) unsigned NOT NULL default '0',
<   `usepassword` smallint(3) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
>   `practice` tinyint(3) unsigned NOT NULL default '0',
>   `modattempts` tinyint(3) unsigned NOT NULL default '0',
>   `usepassword` int(3) unsigned NOT NULL default '0',
2509,2528c2502,2521
<   `grade` smallint(3) NOT NULL default '0',
<   `custom` smallint(3) unsigned NOT NULL default '0',
<   `ongoing` smallint(3) unsigned NOT NULL default '0',
<   `usemaxgrade` smallint(3) unsigned NOT NULL default '0',
<   `maxanswers` smallint(3) unsigned NOT NULL default '4',
<   `maxattempts` smallint(3) unsigned NOT NULL default '5',
<   `review` smallint(3) unsigned NOT NULL default '0',
<   `nextpagedefault` smallint(3) unsigned NOT NULL default '0',
<   `feedback` smallint(3) unsigned NOT NULL default '1',
<   `minquestions` smallint(3) unsigned NOT NULL default '0',
<   `maxpages` smallint(3) unsigned NOT NULL default '0',
<   `timed` smallint(3) unsigned NOT NULL default '0',
<   `maxtime` bigint(10) unsigned NOT NULL default '0',
<   `retake` smallint(3) unsigned NOT NULL default '1',
<   `mediaheight` bigint(10) unsigned NOT NULL default '100',
<   `mediawidth` bigint(10) unsigned NOT NULL default '650',
<   `mediaclose` smallint(3) unsigned NOT NULL default '0',
<   `slideshow` smallint(3) unsigned NOT NULL default '0',
<   `width` bigint(10) unsigned NOT NULL default '640',
<   `height` bigint(10) unsigned NOT NULL default '480',
---
>   `grade` tinyint(3) NOT NULL default '0',
>   `custom` int(3) unsigned NOT NULL default '0',
>   `ongoing` int(3) unsigned NOT NULL default '0',
>   `usemaxgrade` tinyint(3) unsigned NOT NULL default '0',
>   `maxanswers` int(3) unsigned NOT NULL default '4',
>   `maxattempts` int(3) unsigned NOT NULL default '5',
>   `review` tinyint(3) unsigned NOT NULL default '0',
>   `nextpagedefault` int(3) unsigned NOT NULL default '0',
>   `feedback` int(10) unsigned NOT NULL default '1',
>   `minquestions` tinyint(3) unsigned NOT NULL default '0',
>   `maxpages` int(3) unsigned NOT NULL default '0',
>   `timed` int(3) unsigned NOT NULL default '0',
>   `maxtime` int(10) unsigned NOT NULL default '0',
>   `retake` int(3) unsigned NOT NULL default '1',
>   `mediaheight` int(10) unsigned NOT NULL default '100',
>   `mediawidth` int(10) unsigned NOT NULL default '650',
>   `mediaclose` tinyint(3) unsigned NOT NULL default '0',
>   `slideshow` int(3) unsigned NOT NULL default '0',
>   `width` int(10) unsigned NOT NULL default '640',
>   `height` int(10) unsigned NOT NULL default '480',
2530,2534c2523,2527
<   `displayleft` smallint(3) unsigned NOT NULL default '0',
<   `displayleftif` smallint(3) unsigned NOT NULL default '0',
<   `progressbar` smallint(3) unsigned NOT NULL default '0',
<   `highscores` smallint(3) unsigned NOT NULL default '0',
<   `maxhighscores` bigint(10) NOT NULL default '0',
---
>   `displayleft` int(3) unsigned NOT NULL default '0',
>   `displayleftif` int(3) unsigned NOT NULL default '0',
>   `progressbar` tinyint(3) unsigned NOT NULL default '0',
>   `highscores` int(3) unsigned NOT NULL default '0',
>   `maxhighscores` int(10) NOT NULL default '0',
2553,2558c2546,2551
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `lessonid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `grade` double unsigned NOT NULL default '0',
<   `late` smallint(3) unsigned NOT NULL default '0',
<   `completed` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `lessonid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `grade` float unsigned NOT NULL default '0',
>   `late` int(3) unsigned NOT NULL default '0',
>   `completed` int(10) unsigned NOT NULL default '0',
2560,2561c2553,2554
<   KEY `mdl_lessgrad_use_ix` (`userid`),
<   KEY `mdl_lessgrad_les_ix` (`lessonid`)
---
>   KEY `lessonid` (`lessonid`),
>   KEY `userid` (`userid`)
2579,2582c2572,2575
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `lessonid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `gradeid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `lessonid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `gradeid` int(10) unsigned NOT NULL default '0',
2584,2587c2577,2578
<   PRIMARY KEY  (`id`),
<   KEY `mdl_lesshighscor_use_ix` (`userid`),
<   KEY `mdl_lesshighscor_les_ix` (`lessonid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='high scores for each lesson';
---
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2604,2613c2595,2604
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `lessonid` bigint(10) unsigned NOT NULL default '0',
<   `prevpageid` bigint(10) unsigned NOT NULL default '0',
<   `nextpageid` bigint(10) unsigned NOT NULL default '0',
<   `qtype` smallint(3) unsigned NOT NULL default '0',
<   `qoption` smallint(3) unsigned NOT NULL default '0',
<   `layout` smallint(3) unsigned NOT NULL default '1',
<   `display` smallint(3) unsigned NOT NULL default '1',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `lessonid` int(10) unsigned NOT NULL default '0',
>   `prevpageid` int(10) unsigned NOT NULL default '0',
>   `nextpageid` int(10) unsigned NOT NULL default '0',
>   `qtype` tinyint(3) unsigned NOT NULL default '0',
>   `qoption` tinyint(3) unsigned NOT NULL default '0',
>   `layout` tinyint(3) unsigned NOT NULL default '1',
>   `display` tinyint(3) unsigned NOT NULL default '1',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
2617c2608
<   KEY `mdl_lesspage_les_ix` (`lessonid`)
---
>   KEY `lessonid` (`lessonid`)
2635,2643c2626,2632
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `lessonid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `starttime` bigint(10) unsigned NOT NULL default '0',
<   `lessontime` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_lesstime_use_ix` (`userid`),
<   KEY `mdl_lesstime_les_ix` (`lessonid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='lesson timer for each lesson';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `lessonid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `starttime` int(10) unsigned NOT NULL default '0',
>   `lessontime` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2660,2662c2649,2651
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `time` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `time` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
2664c2653
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `course` int(10) unsigned NOT NULL default '0',
2666c2655
<   `cmid` bigint(10) unsigned NOT NULL default '0',
---
>   `cmid` int(10) unsigned NOT NULL default '0',
2671,2676c2660,2665
<   KEY `mdl_log_timcoumodact_ix` (`time`,`course`,`module`,`action`),
<   KEY `mdl_log_coumodact_ix` (`course`,`module`,`action`),
<   KEY `mdl_log_couuse_ix` (`course`,`userid`),
<   KEY `mdl_log_use_ix` (`userid`),
<   KEY `mdl_log_inf_ix` (`info`)
< ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Every action is logged as far as possible';
---
>   KEY `timecoursemoduleaction` (`time`,`course`,`module`,`action`),
>   KEY `coursemoduleaction` (`course`,`module`,`action`),
>   KEY `courseuserid` (`course`,`userid`),
>   KEY `userid` (`userid`),
>   KEY `info` (`info`)
> ) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Every action is logged as far as possible.';
2694c2683
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
2700c2689
<   UNIQUE KEY `mdl_logdisp_modact_uix` (`module`,`action`)
---
>   UNIQUE KEY `moduleaction` (`module`,`action`)
2719,2721c2708,2710
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `useridfrom` bigint(10) NOT NULL default '0',
<   `useridto` bigint(10) NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `useridfrom` int(10) NOT NULL default '0',
>   `useridto` int(10) NOT NULL default '0',
2723,2724c2712,2713
<   `format` smallint(4) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) NOT NULL default '0',
---
>   `format` int(4) unsigned NOT NULL default '0',
>   `timecreated` int(10) NOT NULL default '0',
2727,2728c2716,2717
<   KEY `mdl_mess_use_ix` (`useridfrom`),
<   KEY `mdl_mess_use2_ix` (`useridto`)
---
>   KEY `useridfrom` (`useridfrom`),
>   KEY `useridto` (`useridto`)
2746,2748c2735,2737
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `contactid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `contactid` int(10) unsigned NOT NULL default '0',
2751c2740
<   UNIQUE KEY `mdl_messcont_usecon_uix` (`userid`,`contactid`)
---
>   UNIQUE KEY `usercontact` (`userid`,`contactid`)
2769,2771c2758,2760
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `useridfrom` bigint(10) NOT NULL default '0',
<   `useridto` bigint(10) NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `useridfrom` int(10) NOT NULL default '0',
>   `useridto` int(10) NOT NULL default '0',
2773,2775c2762,2764
<   `format` smallint(4) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) NOT NULL default '0',
<   `timeread` bigint(10) NOT NULL default '0',
---
>   `format` int(4) unsigned NOT NULL default '0',
>   `timecreated` int(10) NOT NULL default '0',
>   `timeread` int(10) NOT NULL default '0',
2779,2780c2768,2769
<   KEY `mdl_messread_use_ix` (`useridfrom`),
<   KEY `mdl_messread_use2_ix` (`useridto`)
---
>   KEY `useridfrom` (`useridfrom`),
>   KEY `useridto` (`useridto`)
2798c2787
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
2800,2802c2789,2791
<   `version` bigint(10) NOT NULL default '0',
<   `cron` bigint(10) unsigned NOT NULL default '0',
<   `lastcron` bigint(10) unsigned NOT NULL default '0',
---
>   `version` int(10) NOT NULL default '0',
>   `cron` int(10) unsigned NOT NULL default '0',
>   `lastcron` int(10) unsigned NOT NULL default '0',
2806,2807c2795,2797
<   KEY `mdl_modu_nam_ix` (`name`)
< ) ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='modules available in the site';
---
>   UNIQUE KEY `id` (`id`),
>   KEY `name` (`name`)
> ) ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2825c2815
<   `id` bigint(10) NOT NULL auto_increment,
---
>   `id` int(10) NOT NULL auto_increment,
2827,2831c2817,2821
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `groupid` bigint(10) unsigned NOT NULL default '0',
<   `moduleid` bigint(10) unsigned NOT NULL default '0',
<   `coursemoduleid` bigint(10) unsigned NOT NULL default '0',
---
>   `userid` int(10) NOT NULL default '0',
>   `courseid` int(10) NOT NULL default '0',
>   `groupid` int(10) NOT NULL default '0',
>   `moduleid` int(10) NOT NULL default '0',
>   `coursemoduleid` int(10) NOT NULL default '0',
2836,2837c2826,2827
<   `rating` bigint(10) unsigned NOT NULL default '0',
<   `format` bigint(10) unsigned NOT NULL default '0',
---
>   `rating` int(10) NOT NULL default '0',
>   `format` int(10) NOT NULL default '0',
2839,2840c2829,2830
<   `lastmodified` bigint(10) unsigned NOT NULL default '0',
<   `created` bigint(10) unsigned NOT NULL default '0',
---
>   `lastmodified` int(10) NOT NULL default '0',
>   `created` int(10) NOT NULL default '0',
2842,2845c2832,2835
<   UNIQUE KEY `mdl_post_iduse_uix` (`id`,`userid`),
<   KEY `mdl_post_las_ix` (`lastmodified`),
<   KEY `mdl_post_mod_ix` (`module`),
<   KEY `mdl_post_sub_ix` (`subject`)
---
>   UNIQUE KEY `id_user_idx` (`id`,`userid`),
>   KEY `post_lastmodified_idx` (`lastmodified`),
>   KEY `post_module_idx` (`module`),
>   KEY `post_subject_idx` (`subject`)
2863,2865c2853,2855
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `category` bigint(10) NOT NULL default '0',
<   `parent` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) NOT NULL auto_increment,
>   `category` int(10) NOT NULL default '0',
>   `parent` int(10) unsigned NOT NULL default '0',
2871,2872c2861,2862
<   `defaultgrade` bigint(10) unsigned NOT NULL default '1',
<   `penalty` double NOT NULL default '0.1',
---
>   `defaultgrade` int(10) unsigned NOT NULL default '1',
>   `penalty` float NOT NULL default '0.1',
2874c2864
<   `length` bigint(10) unsigned NOT NULL default '1',
---
>   `length` int(10) unsigned NOT NULL default '1',
2877c2867
<   `hidden` tinyint(1) unsigned NOT NULL default '0',
---
>   `hidden` int(1) unsigned NOT NULL default '0',
2879,2881c2869,2870
<   KEY `mdl_ques_cat_ix` (`category`),
<   KEY `mdl_ques_par_ix` (`parent`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='The questions themselves';
---
>   KEY `category` (`category`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='The quiz questions themselves';
2898,2899c2887,2888
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
2901c2890
<   `fraction` double NOT NULL default '0',
---
>   `fraction` float NOT NULL default '0',
2904c2893
<   KEY `mdl_quesansw_que_ix` (`question`)
---
>   KEY `question` (`question`)
2922c2911
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
2942,2944c2931,2933
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `answer` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
>   `answer` int(10) unsigned NOT NULL default '0',
2946,2948c2935,2937
<   `tolerancetype` bigint(10) NOT NULL default '1',
<   `correctanswerlength` bigint(10) NOT NULL default '2',
<   `correctanswerformat` bigint(10) NOT NULL default '2',
---
>   `tolerancetype` int(10) NOT NULL default '1',
>   `correctanswerlength` int(10) NOT NULL default '2',
>   `correctanswerformat` int(10) NOT NULL default '2',
2950,2951c2939,2940
<   KEY `mdl_quescalc_ans_ix` (`answer`),
<   KEY `mdl_quescalc_que_ix` (`question`)
---
>   KEY `question` (`question`),
>   KEY `answer` (`answer`)
2969,2970c2958,2959
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
2973c2962
<   `publish` smallint(4) NOT NULL default '0',
---
>   `publish` tinyint(4) NOT NULL default '0',
2975,2976c2964,2965
<   `parent` bigint(10) unsigned NOT NULL default '0',
<   `sortorder` bigint(10) unsigned NOT NULL default '999',
---
>   `parent` int(10) unsigned NOT NULL default '0',
>   `sortorder` int(10) unsigned NOT NULL default '999',
2978,2979c2967
<   KEY `mdl_quescate_cou_ix` (`course`),
<   KEY `mdl_quescate_par_ix` (`parent`)
---
>   KEY `course` (`course`)
2997,2998c2985,2986
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `category` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `category` int(10) unsigned NOT NULL default '0',
3000c2988
<   `type` bigint(10) NOT NULL default '0',
---
>   `type` int(10) NOT NULL default '0',
3002c2990
<   `itemcount` bigint(10) unsigned NOT NULL default '0',
---
>   `itemcount` int(10) unsigned NOT NULL default '0',
3004c2992
<   KEY `mdl_quesdatadefi_cat_ix` (`category`)
---
>   KEY `category` (`category`)
3022,3024c3010,3012
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `definition` bigint(10) unsigned NOT NULL default '0',
<   `itemnumber` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `definition` int(10) unsigned NOT NULL default '0',
>   `itemnumber` int(10) unsigned NOT NULL default '0',
3027c3015
<   KEY `mdl_quesdataitem_def_ix` (`definition`)
---
>   KEY `definition` (`definition`)
3045,3047c3033,3035
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `datasetdefinition` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
>   `datasetdefinition` int(10) unsigned NOT NULL default '0',
3049,3051c3037
<   KEY `mdl_quesdata_quedat_ix` (`question`,`datasetdefinition`),
<   KEY `mdl_quesdata_que_ix` (`question`),
<   KEY `mdl_quesdata_dat_ix` (`datasetdefinition`)
---
>   KEY `question` (`question`,`datasetdefinition`)
3069,3070c3055,3056
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
3072c3058
<   `shuffleanswers` smallint(4) NOT NULL default '1',
---
>   `shuffleanswers` tinyint(4) NOT NULL default '1',
3074c3060
<   KEY `mdl_quesmatc_que_ix` (`question`)
---
>   KEY `question` (`question`)
3092,3094c3078,3080
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `code` bigint(10) unsigned NOT NULL default '0',
<   `question` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `code` int(10) unsigned NOT NULL default '0',
>   `question` int(10) unsigned NOT NULL default '0',
3098c3084
<   KEY `mdl_quesmatcsub_que_ix` (`question`)
---
>   KEY `question` (`question`)
3116,3117c3102,3103
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
3120c3106
<   KEY `mdl_quesmult_que_ix` (`question`)
---
>   KEY `question` (`question`)
3138,3140c3124,3126
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `layout` smallint(4) NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
>   `layout` tinyint(4) NOT NULL default '0',
3142,3143c3128,3129
<   `single` smallint(4) NOT NULL default '0',
<   `shuffleanswers` smallint(4) NOT NULL default '1',
---
>   `single` tinyint(4) NOT NULL default '0',
>   `shuffleanswers` tinyint(4) NOT NULL default '1',
3148c3134
<   KEY `mdl_quesmult_que2_ix` (`question`)
---
>   KEY `question` (`question`)
3166,3168c3152,3154
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `answer` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
>   `answer` int(10) unsigned NOT NULL default '0',
3171,3172c3157,3158
<   KEY `mdl_quesnume_ans_ix` (`answer`),
<   KEY `mdl_quesnume_que_ix` (`question`)
---
>   KEY `answer` (`answer`),
>   KEY `question` (`question`)
3190,3191c3176,3177
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
3195c3181
<   KEY `mdl_quesnumeunit_que_ix` (`question`)
---
>   KEY `question` (`question`)
3213,3215c3199,3201
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `choose` bigint(10) unsigned NOT NULL default '4',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
>   `choose` int(10) unsigned NOT NULL default '4',
3217c3203
<   KEY `mdl_quesrand_que_ix` (`question`)
---
>   KEY `question` (`question`)
3235,3237c3221,3223
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `type` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
>   `type` int(10) unsigned NOT NULL default '0',
3240,3241c3226,3227
<   `flags` smallint(3) unsigned NOT NULL default '0',
<   `maxscore` bigint(10) unsigned NOT NULL default '1',
---
>   `flags` tinyint(3) unsigned NOT NULL default '0',
>   `maxscore` int(10) unsigned NOT NULL default '1',
3243c3229
<   KEY `mdl_quesrqp_que_ix` (`question`)
---
>   KEY `question` (`question`)
3261,3262c3247,3248
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `typeid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `typeid` int(10) unsigned NOT NULL default '0',
3266,3267c3252
<   PRIMARY KEY  (`id`),
<   KEY `mdl_quesrqpserv_typ_ix` (`typeid`)
---
>   PRIMARY KEY  (`id`)
3285,3286c3270,3271
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `stateid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `stateid` int(10) unsigned NOT NULL default '0',
3308c3293
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
3311c3296
<   UNIQUE KEY `mdl_quesrqptype_nam_uix` (`name`)
---
>   UNIQUE KEY `name` (`name`)
3329,3334c3314,3319
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `attemptid` bigint(10) unsigned NOT NULL default '0',
<   `questionid` bigint(10) unsigned NOT NULL default '0',
<   `newest` bigint(10) unsigned NOT NULL default '0',
<   `newgraded` bigint(10) unsigned NOT NULL default '0',
<   `sumpenalty` double NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `attemptid` int(10) unsigned NOT NULL default '0',
>   `questionid` int(10) unsigned NOT NULL default '0',
>   `newest` int(10) unsigned NOT NULL default '0',
>   `newgraded` int(10) unsigned NOT NULL default '0',
>   `sumpenalty` float NOT NULL default '0',
3337,3341c3322
<   UNIQUE KEY `mdl_quessess_attque_uix` (`attemptid`,`questionid`),
<   KEY `mdl_quessess_att_ix` (`attemptid`),
<   KEY `mdl_quessess_que_ix` (`questionid`),
<   KEY `mdl_quessess_new_ix` (`newest`),
<   KEY `mdl_quessess_new2_ix` (`newgraded`)
---
>   UNIQUE KEY `attemptid` (`attemptid`,`questionid`)
3359,3360c3340,3341
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
3364c3345
<   KEY `mdl_quesshor_que_ix` (`question`)
---
>   KEY `question` (`question`)
3382,3386c3363,3367
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `attempt` bigint(10) unsigned NOT NULL default '0',
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `originalquestion` bigint(10) unsigned NOT NULL default '0',
<   `seq_number` mediumint(6) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `attempt` int(10) unsigned NOT NULL default '0',
>   `question` int(10) unsigned NOT NULL default '0',
>   `originalquestion` int(10) unsigned NOT NULL default '0',
>   `seq_number` int(6) unsigned NOT NULL default '0',
3388,3396c3369,3377
<   `timestamp` bigint(10) unsigned NOT NULL default '0',
<   `event` smallint(4) unsigned NOT NULL default '0',
<   `grade` double NOT NULL default '0',
<   `raw_grade` double NOT NULL default '0',
<   `penalty` double NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_quesstat_att_ix` (`attempt`),
<   KEY `mdl_quesstat_que_ix` (`question`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Stores user responses to an attempt, and percentage grades';
---
>   `timestamp` int(10) unsigned NOT NULL default '0',
>   `event` int(4) unsigned NOT NULL default '0',
>   `grade` float NOT NULL default '0',
>   `raw_grade` float NOT NULL default '0',
>   `penalty` float NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   KEY `attempt` (`attempt`),
>   KEY `question` (`question`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Stores user responses to a quiz, and percentage grades';
3413,3416c3394,3397
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `trueanswer` bigint(10) unsigned NOT NULL default '0',
<   `falseanswer` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `question` int(10) unsigned NOT NULL default '0',
>   `trueanswer` int(10) unsigned NOT NULL default '0',
>   `falseanswer` int(10) unsigned NOT NULL default '0',
3418c3399
<   KEY `mdl_questrue_que_ix` (`question`)
---
>   KEY `question` (`question`)
3436,3437c3417,3418
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
3440,3451c3421,3432
<   `timeopen` bigint(10) unsigned NOT NULL default '0',
<   `timeclose` bigint(10) unsigned NOT NULL default '0',
<   `optionflags` bigint(10) unsigned NOT NULL default '0',
<   `penaltyscheme` smallint(4) unsigned NOT NULL default '0',
<   `attempts` mediumint(6) NOT NULL default '0',
<   `attemptonlast` smallint(4) NOT NULL default '0',
<   `grademethod` smallint(4) NOT NULL default '1',
<   `decimalpoints` smallint(4) NOT NULL default '2',
<   `review` bigint(10) unsigned NOT NULL default '0',
<   `questionsperpage` bigint(10) NOT NULL default '0',
<   `shufflequestions` smallint(4) NOT NULL default '0',
<   `shuffleanswers` smallint(4) NOT NULL default '0',
---
>   `timeopen` int(10) unsigned NOT NULL default '0',
>   `timeclose` int(10) unsigned NOT NULL default '0',
>   `optionflags` int(10) unsigned NOT NULL default '0',
>   `penaltyscheme` int(4) unsigned NOT NULL default '0',
>   `attempts` smallint(6) NOT NULL default '0',
>   `attemptonlast` tinyint(4) NOT NULL default '0',
>   `grademethod` tinyint(4) NOT NULL default '1',
>   `decimalpoints` int(4) NOT NULL default '2',
>   `review` int(10) unsigned NOT NULL default '0',
>   `questionsperpage` int(10) NOT NULL default '0',
>   `shufflequestions` tinyint(4) NOT NULL default '0',
>   `shuffleanswers` tinyint(4) NOT NULL default '0',
3453,3457c3434,3438
<   `sumgrades` bigint(10) NOT NULL default '0',
<   `grade` bigint(10) NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `timelimit` tinyint(2) unsigned NOT NULL default '0',
---
>   `sumgrades` int(10) NOT NULL default '0',
>   `grade` int(10) NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `timelimit` int(2) unsigned NOT NULL default '0',
3460,3462c3441,3443
<   `popup` smallint(4) NOT NULL default '0',
<   `delay1` bigint(10) NOT NULL default '0',
<   `delay2` bigint(10) NOT NULL default '0',
---
>   `popup` tinyint(4) NOT NULL default '0',
>   `delay1` int(10) NOT NULL default '0',
>   `delay2` int(10) NOT NULL default '0',
3464c3445
<   KEY `mdl_quiz_cou_ix` (`course`)
---
>   KEY `course` (`course`)
3482,3490c3463,3471
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `uniqueid` bigint(10) unsigned NOT NULL default '0',
<   `quiz` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `attempt` mediumint(6) NOT NULL default '0',
<   `sumgrades` double NOT NULL default '0',
<   `timestart` bigint(10) unsigned NOT NULL default '0',
<   `timefinish` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `uniqueid` int(10) unsigned NOT NULL default '0',
>   `quiz` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `attempt` smallint(6) NOT NULL default '0',
>   `sumgrades` float NOT NULL default '0',
>   `timestart` int(10) unsigned NOT NULL default '0',
>   `timefinish` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
3492c3473
<   `preview` smallint(3) unsigned NOT NULL default '0',
---
>   `preview` tinyint(3) unsigned NOT NULL default '0',
3494,3496c3475,3477
<   UNIQUE KEY `mdl_quizatte_uni_uix` (`uniqueid`),
<   KEY `mdl_quizatte_use_ix` (`userid`),
<   KEY `mdl_quizatte_qui_ix` (`quiz`)
---
>   UNIQUE KEY `uniqueid` (`uniqueid`),
>   KEY `quiz` (`quiz`),
>   KEY `userid` (`userid`)
3514,3515c3495,3496
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `quizid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `quizid` int(10) unsigned NOT NULL default '0',
3520c3501
<   KEY `mdl_quizfeed_qui_ix` (`quizid`)
---
>   KEY `quizid` (`quizid`)
3538,3540c3519,3521
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `quiz` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `quiz` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
3542c3523
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
3544,3545c3525,3526
<   KEY `mdl_quizgrad_use_ix` (`userid`),
<   KEY `mdl_quizgrad_qui_ix` (`quiz`)
---
>   KEY `quiz` (`quiz`),
>   KEY `userid` (`userid`)
3563,3566c3544,3547
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `quiz` bigint(10) unsigned NOT NULL default '0',
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `grade` mediumint(6) NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `quiz` int(10) unsigned NOT NULL default '0',
>   `question` int(10) unsigned NOT NULL default '0',
>   `grade` smallint(6) NOT NULL default '0',
3568,3569c3549,3550
<   KEY `mdl_quizquesinst_qui_ix` (`quiz`),
<   KEY `mdl_quizquesinst_que_ix` (`question`)
---
>   KEY `quiz` (`quiz`),
>   KEY `question` (`question`)
3587,3599c3568,3576
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `quiz` bigint(10) unsigned NOT NULL default '0',
<   `oldquestion` bigint(10) unsigned NOT NULL default '0',
<   `newquestion` bigint(10) unsigned NOT NULL default '0',
<   `originalquestion` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `timestamp` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_quizquesvers_qui_ix` (`quiz`),
<   KEY `mdl_quizquesvers_old_ix` (`oldquestion`),
<   KEY `mdl_quizquesvers_new_ix` (`newquestion`),
<   KEY `mdl_quizquesvers_ori_ix` (`originalquestion`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='quiz_question_versions table retrofitted from MySQL';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `quiz` int(10) unsigned NOT NULL default '0',
>   `oldquestion` int(10) unsigned NOT NULL default '0',
>   `newquestion` int(10) unsigned NOT NULL default '0',
>   `originalquestion` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `timestamp` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='The mapping between old and new versions of a question';
3616,3617c3593,3594
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
3625c3602
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
3627,3628c3604,3606
<   KEY `mdl_reso_cou_ix` (`course`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='each record is one resource and its config data';
---
>   UNIQUE KEY `id` (`id`),
>   KEY `course` (`course`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3645c3623
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
3649c3627
<   `sortorder` bigint(10) unsigned NOT NULL default '0',
---
>   `sortorder` int(10) unsigned NOT NULL default '0',
3651,3652c3629,3631
<   UNIQUE KEY `mdl_role_sor_uix` (`sortorder`)
< ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='moodle roles';
---
>   UNIQUE KEY `mdl_role_sor_uix` (`sortorder`),
>   KEY `sortorder` (`sortorder`)
> ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3670,3677c3649,3656
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `roleid` bigint(10) unsigned NOT NULL default '0',
<   `allowassign` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   UNIQUE KEY `mdl_rolealloassi_rolall_uix` (`roleid`,`allowassign`),
<   KEY `mdl_rolealloassi_rol_ix` (`roleid`),
<   KEY `mdl_rolealloassi_all_ix` (`allowassign`)
< ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='this defines what role can assign what role';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `roleid` int(10) unsigned NOT NULL default '0',
>   `allowassign` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `roleid-allowassign` (`roleid`,`allowassign`),
>   KEY `roleid` (`roleid`),
>   KEY `allowassign` (`allowassign`)
> ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3695,3702c3674,3681
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `roleid` bigint(10) unsigned NOT NULL default '0',
<   `allowoverride` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   UNIQUE KEY `mdl_rolealloover_rolall_uix` (`roleid`,`allowoverride`),
<   KEY `mdl_rolealloover_rol_ix` (`roleid`),
<   KEY `mdl_rolealloover_all_ix` (`allowoverride`)
< ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='this defines what role can override what role';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `roleid` int(10) unsigned NOT NULL default '0',
>   `allowoverride` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `roleid-allowoverride` (`roleid`,`allowoverride`),
>   KEY `roleid` (`roleid`),
>   KEY `allowoverride` (`allowoverride`)
> ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3720,3728c3699,3707
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `roleid` bigint(10) unsigned NOT NULL default '0',
<   `contextid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `hidden` tinyint(1) unsigned NOT NULL default '0',
<   `timestart` bigint(10) unsigned NOT NULL default '0',
<   `timeend` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `modifierid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `roleid` int(10) unsigned NOT NULL default '0',
>   `contextid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `hidden` int(1) unsigned NOT NULL default '0',
>   `timestart` int(10) unsigned NOT NULL default '0',
>   `timeend` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `modifierid` int(10) unsigned NOT NULL default '0',
3730c3709
<   `sortorder` bigint(10) unsigned NOT NULL default '0',
---
>   `sortorder` int(10) unsigned NOT NULL default '0',
3732,3737c3711,3716
<   UNIQUE KEY `mdl_roleassi_conroluse_uix` (`contextid`,`roleid`,`userid`),
<   KEY `mdl_roleassi_sor_ix` (`sortorder`),
<   KEY `mdl_roleassi_rol_ix` (`roleid`),
<   KEY `mdl_roleassi_con_ix` (`contextid`),
<   KEY `mdl_roleassi_use_ix` (`userid`)
< ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='assigning roles to different context';
---
>   UNIQUE KEY `contextid-roleid-userid` (`contextid`,`roleid`,`userid`),
>   KEY `roleid` (`roleid`),
>   KEY `contextid` (`contextid`),
>   KEY `userid` (`userid`),
>   KEY `sortorder` (`sortorder`)
> ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3755,3757c3734,3736
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `contextid` bigint(10) unsigned NOT NULL default '0',
<   `roleid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `contextid` int(10) unsigned NOT NULL default '0',
>   `roleid` int(10) unsigned NOT NULL default '0',
3759,3768c3738,3746
<   `permission` bigint(10) NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `modifierid` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   UNIQUE KEY `mdl_rolecapa_rolconcap_uix` (`roleid`,`contextid`,`capability`),
<   KEY `mdl_rolecapa_rol_ix` (`roleid`),
<   KEY `mdl_rolecapa_con_ix` (`contextid`),
<   KEY `mdl_rolecapa_mod_ix` (`modifierid`),
<   KEY `mdl_rolecapa_cap_ix` (`capability`)
< ) ENGINE=MyISAM AUTO_INCREMENT=446 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='permission has to be signed, overriding a capability for a p';
---
>   `permission` int(10) NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `modifierid` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `roleid-contextid-capability` (`roleid`,`contextid`,`capability`),
>   KEY `roleid` (`roleid`),
>   KEY `contextid` (`contextid`),
>   KEY `modifierid` (`modifierid`)
> ) ENGINE=MyISAM AUTO_INCREMENT=446 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3786,3788c3764,3766
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `roleid` bigint(10) unsigned NOT NULL default '0',
<   `contextid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `roleid` int(10) unsigned NOT NULL default '0',
>   `contextid` int(10) unsigned NOT NULL default '0',
3791,3794c3769,3772
<   UNIQUE KEY `mdl_rolename_rolcon_uix` (`roleid`,`contextid`),
<   KEY `mdl_rolename_rol_ix` (`roleid`),
<   KEY `mdl_rolename_con_ix` (`contextid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='role names in native strings';
---
>   UNIQUE KEY `roleid-contextid` (`roleid`,`contextid`),
>   KEY `roleid` (`roleid`),
>   KEY `contextid` (`contextid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3811,3813c3789,3791
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
3817c3795
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
3819c3797
<   KEY `mdl_scal_cou_ix` (`courseid`)
---
>   KEY `courseid` (`courseid`)
3837,3838c3815,3816
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
3842c3820
<   `maxgrade` double NOT NULL default '0',
---
>   `maxgrade` float NOT NULL default '0',
3844,3846c3822,3824
<   `maxattempt` bigint(10) NOT NULL default '1',
<   `launch` bigint(10) unsigned NOT NULL default '0',
<   `skipview` tinyint(1) unsigned NOT NULL default '1',
---
>   `maxattempt` int(10) NOT NULL default '1',
>   `launch` int(10) unsigned NOT NULL default '0',
>   `skipview` tinyint(3) unsigned NOT NULL default '1',
3854,3859c3832,3838
<   `width` bigint(10) unsigned NOT NULL default '100',
<   `height` bigint(10) unsigned NOT NULL default '600',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_scor_cou_ix` (`course`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='each table is one SCORM module and its configuration';
---
>   `width` int(10) unsigned NOT NULL default '100',
>   `height` int(10) unsigned NOT NULL default '600',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `id` (`id`),
>   KEY `course` (`course`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3876,3877c3855,3856
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `scorm` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `scorm` int(10) unsigned NOT NULL default '0',
3894,3895c3873,3875
<   KEY `mdl_scorscoe_sco_ix` (`scorm`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='each SCO part of the SCORM module';
---
>   UNIQUE KEY `id` (`id`),
>   KEY `scorm` (`scorm`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3912,3916c3892,3896
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `scormid` bigint(10) NOT NULL default '0',
<   `scoid` bigint(10) unsigned NOT NULL default '0',
<   `attempt` bigint(10) unsigned NOT NULL default '1',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `scormid` int(10) NOT NULL default '0',
>   `scoid` int(10) unsigned NOT NULL default '0',
>   `attempt` int(10) unsigned NOT NULL default '1',
3919c3899
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
3921,3926c3901,3906
<   UNIQUE KEY `mdl_scorscoetrac_usescosco_uix` (`userid`,`scormid`,`scoid`,`attempt`,`element`),
<   KEY `mdl_scorscoetrac_use_ix` (`userid`),
<   KEY `mdl_scorscoetrac_ele_ix` (`element`),
<   KEY `mdl_scorscoetrac_sco_ix` (`scormid`),
<   KEY `mdl_scorscoetrac_sco2_ix` (`scoid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to track SCOes';
---
>   UNIQUE KEY `track` (`userid`,`scormid`,`scoid`,`attempt`,`element`),
>   KEY `userid` (`userid`),
>   KEY `scormid` (`scormid`),
>   KEY `scoid` (`scoid`),
>   KEY `element` (`element`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3945c3925
<   `expireref` varchar(250) collate utf8_unicode_ci default '',
---
>   `expireref` varchar(250) collate utf8_unicode_ci default NULL,
3970,3972c3950,3952
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `timeend` bigint(10) unsigned NOT NULL default '0',
<   `roleid` bigint(10) unsigned NOT NULL default '0',
---
>   `courseid` bigint(10) unsigned NOT NULL,
>   `roleid` bigint(10) unsigned NOT NULL,
>   `timeend` bigint(10) unsigned NOT NULL,
3974,3975c3954,3955
<   `stat1` bigint(10) unsigned NOT NULL default '0',
<   `stat2` bigint(10) unsigned NOT NULL default '0',
---
>   `stat1` bigint(10) unsigned NOT NULL,
>   `stat2` bigint(10) unsigned NOT NULL,
3980c3960
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to accumulate daily stats';
---
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3998,4000c3978,3980
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `timeend` bigint(10) unsigned NOT NULL default '0',
<   `roleid` bigint(10) unsigned NOT NULL default '0',
---
>   `courseid` bigint(10) unsigned NOT NULL,
>   `roleid` bigint(10) unsigned NOT NULL,
>   `timeend` bigint(10) unsigned NOT NULL,
4002,4003c3982,3983
<   `stat1` bigint(10) unsigned NOT NULL default '0',
<   `stat2` bigint(10) unsigned NOT NULL default '0',
---
>   `stat1` bigint(10) unsigned NOT NULL,
>   `stat2` bigint(10) unsigned NOT NULL,
4008c3988
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='To accumulate monthly stats';
---
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4025,4031c4005,4011
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `roleid` bigint(10) unsigned NOT NULL default '0',
<   `timeend` bigint(10) unsigned NOT NULL default '0',
<   `statsreads` bigint(10) unsigned NOT NULL default '0',
<   `statswrites` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `roleid` int(10) unsigned NOT NULL default '0',
>   `timeend` int(10) unsigned NOT NULL default '0',
>   `statsreads` int(10) unsigned NOT NULL default '0',
>   `statswrites` int(10) unsigned NOT NULL default '0',
4034,4038c4014,4018
<   KEY `mdl_statuserdail_cou_ix` (`courseid`),
<   KEY `mdl_statuserdail_use_ix` (`userid`),
<   KEY `mdl_statuserdail_rol_ix` (`roleid`),
<   KEY `mdl_statuserdail_tim_ix` (`timeend`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='To accumulate daily stats per course/user';
---
>   KEY `courseid` (`courseid`),
>   KEY `userid` (`userid`),
>   KEY `roleid` (`roleid`),
>   KEY `timeend` (`timeend`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4055,4061c4035,4041
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `roleid` bigint(10) unsigned NOT NULL default '0',
<   `timeend` bigint(10) unsigned NOT NULL default '0',
<   `statsreads` bigint(10) unsigned NOT NULL default '0',
<   `statswrites` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `roleid` int(10) unsigned NOT NULL default '0',
>   `timeend` int(10) unsigned NOT NULL default '0',
>   `statsreads` int(10) unsigned NOT NULL default '0',
>   `statswrites` int(10) unsigned NOT NULL default '0',
4064,4068c4044,4048
<   KEY `mdl_statusermont_cou_ix` (`courseid`),
<   KEY `mdl_statusermont_use_ix` (`userid`),
<   KEY `mdl_statusermont_rol_ix` (`roleid`),
<   KEY `mdl_statusermont_tim_ix` (`timeend`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='To accumulate monthly stats per course/user';
---
>   KEY `courseid` (`courseid`),
>   KEY `userid` (`userid`),
>   KEY `roleid` (`roleid`),
>   KEY `timeend` (`timeend`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4085,4091c4065,4071
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `roleid` bigint(10) unsigned NOT NULL default '0',
<   `timeend` bigint(10) unsigned NOT NULL default '0',
<   `statsreads` bigint(10) unsigned NOT NULL default '0',
<   `statswrites` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `roleid` int(10) unsigned NOT NULL default '0',
>   `timeend` int(10) unsigned NOT NULL default '0',
>   `statsreads` int(10) unsigned NOT NULL default '0',
>   `statswrites` int(10) unsigned NOT NULL default '0',
4094,4098c4074,4078
<   KEY `mdl_statuserweek_cou_ix` (`courseid`),
<   KEY `mdl_statuserweek_use_ix` (`userid`),
<   KEY `mdl_statuserweek_rol_ix` (`roleid`),
<   KEY `mdl_statuserweek_tim_ix` (`timeend`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='To accumulate weekly stats per course/user';
---
>   KEY `courseid` (`courseid`),
>   KEY `userid` (`userid`),
>   KEY `roleid` (`roleid`),
>   KEY `timeend` (`timeend`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4116,4118c4096,4098
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `timeend` bigint(10) unsigned NOT NULL default '0',
<   `roleid` bigint(10) unsigned NOT NULL default '0',
---
>   `courseid` bigint(10) unsigned NOT NULL,
>   `roleid` bigint(10) unsigned NOT NULL,
>   `timeend` bigint(10) unsigned NOT NULL,
4120,4121c4100,4101
<   `stat1` bigint(10) unsigned NOT NULL default '0',
<   `stat2` bigint(10) unsigned NOT NULL default '0',
---
>   `stat1` bigint(10) unsigned NOT NULL,
>   `stat2` bigint(10) unsigned NOT NULL,
4126c4106
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='To accumulate weekly stats';
---
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4143,4148c4123,4128
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
<   `template` bigint(10) unsigned NOT NULL default '0',
<   `days` mediumint(6) NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
>   `template` int(10) unsigned NOT NULL default '0',
>   `days` smallint(6) NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
4153,4154c4133,4134
<   KEY `mdl_surv_cou_ix` (`course`)
< ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Each record is one SURVEY module with its configuration';
---
>   KEY `course` (`course`)
> ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='all surveys';
4172,4174c4152,4154
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `survey` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `survey` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
4177,4179c4157,4160
<   KEY `mdl_survanal_use_ix` (`userid`),
<   KEY `mdl_survanal_sur_ix` (`survey`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='text about each survey submission';
---
>   UNIQUE KEY `id` (`id`),
>   KEY `survey` (`survey`),
>   KEY `userid` (`userid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4196,4200c4177,4181
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `survey` bigint(10) unsigned NOT NULL default '0',
<   `question` bigint(10) unsigned NOT NULL default '0',
<   `time` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `survey` int(10) unsigned NOT NULL default '0',
>   `question` int(10) unsigned NOT NULL default '0',
>   `time` int(10) unsigned NOT NULL default '0',
4204,4207c4185,4189
<   KEY `mdl_survansw_use_ix` (`userid`),
<   KEY `mdl_survansw_sur_ix` (`survey`),
<   KEY `mdl_survansw_que_ix` (`question`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='the answers to each questions filled by the users';
---
>   UNIQUE KEY `id` (`id`),
>   KEY `userid` (`userid`),
>   KEY `survey` (`survey`),
>   KEY `question` (`question`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4224c4206
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
4229c4211
<   `type` smallint(3) NOT NULL default '0',
---
>   `type` tinyint(3) NOT NULL default '0',
4232c4214
< ) ENGINE=MyISAM AUTO_INCREMENT=74 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='the questions conforming one survey';
---
> ) ENGINE=MyISAM AUTO_INCREMENT=74 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4250c4232
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) NOT NULL auto_increment,
4252c4234
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `userid` int(10) NOT NULL default '0',
4255,4257c4237,4239
<   KEY `mdl_tags_typuse_ix` (`type`,`userid`),
<   KEY `mdl_tags_tex_ix` (`text`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='tags structure for moodle';
---
>   KEY `tags_typeuserid_idx` (`type`,`userid`),
>   KEY `tags_text_idx` (`text`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='tags structure for moodle.';
4274c4256
<   `id` bigint(10) NOT NULL auto_increment,
---
>   `id` int(10) NOT NULL auto_increment,
4276c4258
<   `year` bigint(11) NOT NULL default '0',
---
>   `year` int(11) NOT NULL default '0',
4278,4279c4260,4261
<   `gmtoff` bigint(11) NOT NULL default '0',
<   `dstoff` bigint(11) NOT NULL default '0',
---
>   `gmtoff` int(11) NOT NULL default '0',
>   `dstoff` int(11) NOT NULL default '0',
4281,4283c4263,4265
<   `dst_startday` smallint(3) NOT NULL default '0',
<   `dst_weekday` smallint(3) NOT NULL default '0',
<   `dst_skipweeks` smallint(3) NOT NULL default '0',
---
>   `dst_startday` tinyint(3) NOT NULL default '0',
>   `dst_weekday` tinyint(3) NOT NULL default '0',
>   `dst_skipweeks` tinyint(3) NOT NULL default '0',
4286,4288c4268,4270
<   `std_startday` smallint(3) NOT NULL default '0',
<   `std_weekday` smallint(3) NOT NULL default '0',
<   `std_skipweeks` smallint(3) NOT NULL default '0',
---
>   `std_startday` tinyint(3) NOT NULL default '0',
>   `std_weekday` tinyint(3) NOT NULL default '0',
>   `std_skipweeks` tinyint(3) NOT NULL default '0',
4308c4290
<   `id` bigint(10) unsigned NOT NULL auto_increment,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
4331c4313
<   `country` varchar(2) collate utf8_unicode_ci NOT NULL default '',
---
>   `country` char(2) collate utf8_unicode_ci NOT NULL default '',
4335,4338c4317,4320
<   `firstaccess` bigint(10) unsigned NOT NULL default '0',
<   `lastaccess` bigint(10) unsigned NOT NULL default '0',
<   `lastlogin` bigint(10) unsigned NOT NULL default '0',
<   `currentlogin` bigint(10) unsigned NOT NULL default '0',
---
>   `firstaccess` int(10) unsigned NOT NULL default '0',
>   `lastaccess` int(10) unsigned NOT NULL default '0',
>   `lastlogin` int(10) unsigned NOT NULL default '0',
>   `currentlogin` int(10) unsigned NOT NULL default '0',
4348c4330
<   `ajax` tinyint(1) unsigned NOT NULL default '1',
---
>   `ajax` int(1) unsigned NOT NULL default '1',
4351,4352c4333,4334
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `trustbitmask` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `trustbitmask` int(10) unsigned NOT NULL default '0',
4354,4364c4336,4347
<   UNIQUE KEY `mdl_user_use_uix` (`username`),
<   KEY `mdl_user_del_ix` (`deleted`),
<   KEY `mdl_user_con_ix` (`confirmed`),
<   KEY `mdl_user_fir_ix` (`firstname`),
<   KEY `mdl_user_las_ix` (`lastname`),
<   KEY `mdl_user_cit_ix` (`city`),
<   KEY `mdl_user_cou_ix` (`country`),
<   KEY `mdl_user_las2_ix` (`lastaccess`),
<   KEY `mdl_user_ema_ix` (`email`),
<   KEY `mdl_user_aut_ix` (`auth`),
<   KEY `mdl_user_idn_ix` (`idnumber`)
---
>   UNIQUE KEY `id` (`id`),
>   UNIQUE KEY `username` (`username`),
>   KEY `user_deleted` (`deleted`),
>   KEY `user_confirmed` (`confirmed`),
>   KEY `user_firstname` (`firstname`),
>   KEY `user_lastname` (`lastname`),
>   KEY `user_city` (`city`),
>   KEY `user_country` (`country`),
>   KEY `user_lastaccess` (`lastaccess`),
>   KEY `user_email` (`email`),
>   KEY `auth` (`auth`),
>   KEY `idnumber` (`idnumber`)
4453,4461c4436,4444
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `courseid` bigint(10) unsigned NOT NULL default '0',
<   `timeaccess` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   UNIQUE KEY `mdl_userlast_usecou_uix` (`userid`,`courseid`),
<   KEY `mdl_userlast_use_ix` (`userid`),
<   KEY `mdl_userlast_cou_ix` (`courseid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='To keep track of course page access times, used in online pa';
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
>   `courseid` int(10) unsigned NOT NULL default '0',
>   `timeaccess` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `userid-courseid` (`userid`,`courseid`),
>   KEY `userid` (`userid`),
>   KEY `courseid` (`courseid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='time user last accessed any page in a course';
4478,4479c4461,4462
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `userid` int(10) unsigned NOT NULL default '0',
4483,4484c4466,4468
<   UNIQUE KEY `mdl_userpref_usenam_uix` (`userid`,`name`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Allows modules to store arbitrary user preferences';
---
>   UNIQUE KEY `id` (`id`),
>   KEY `useridname` (`userid`,`name`)
> ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Allows modules to store arbitrary user preferences';
4501,4502c4486,4487
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
4507,4514c4492,4499
<   `ewikiprinttitle` smallint(4) unsigned NOT NULL default '1',
<   `htmlmode` smallint(4) unsigned NOT NULL default '0',
<   `ewikiacceptbinary` smallint(4) unsigned NOT NULL default '0',
<   `disablecamelcase` smallint(4) unsigned NOT NULL default '0',
<   `setpageflags` smallint(4) unsigned NOT NULL default '1',
<   `strippages` smallint(4) unsigned NOT NULL default '1',
<   `removepages` smallint(4) unsigned NOT NULL default '1',
<   `revertchanges` smallint(4) unsigned NOT NULL default '1',
---
>   `ewikiprinttitle` tinyint(4) NOT NULL default '1',
>   `htmlmode` tinyint(4) NOT NULL default '0',
>   `ewikiacceptbinary` tinyint(4) NOT NULL default '0',
>   `disablecamelcase` tinyint(4) NOT NULL default '0',
>   `setpageflags` tinyint(4) NOT NULL default '1',
>   `strippages` tinyint(4) NOT NULL default '1',
>   `removepages` tinyint(4) NOT NULL default '1',
>   `revertchanges` tinyint(4) NOT NULL default '1',
4516c4501
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) NOT NULL default '0',
4518,4519c4503,4504
<   KEY `mdl_wiki_cou_ix` (`course`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Main wik table';
---
>   KEY `course` (`course`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Main wiki table';
4536,4540c4521,4525
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `wikiid` bigint(10) unsigned NOT NULL default '0',
<   `course` bigint(10) unsigned NOT NULL default '0',
<   `groupid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) NOT NULL auto_increment,
>   `wikiid` int(10) NOT NULL default '0',
>   `course` int(10) NOT NULL default '0',
>   `groupid` int(10) NOT NULL default '0',
>   `userid` int(10) NOT NULL default '0',
4542c4527
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
---
>   `timemodified` int(10) NOT NULL default '0',
4544,4549c4529,4534
<   KEY `mdl_wikientr_cou_ix` (`course`),
<   KEY `mdl_wikientr_gro_ix` (`groupid`),
<   KEY `mdl_wikientr_use_ix` (`userid`),
<   KEY `mdl_wikientr_pag_ix` (`pagename`),
<   KEY `mdl_wikientr_wik_ix` (`wikiid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Holds entries for each wiki start instance';
---
>   KEY `wikiid` (`wikiid`),
>   KEY `course` (`course`),
>   KEY `gropuid` (`groupid`),
>   KEY `userid` (`userid`),
>   KEY `pagename` (`pagename`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Holds entries for each wiki start instance.';
4566,4567c4551,4552
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `wikiid` bigint(10) unsigned NOT NULL,
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `wikiid` int(10) unsigned NOT NULL,
4569,4576c4554,4560
<   `lockedby` bigint(10) unsigned NOT NULL default '0',
<   `lockedsince` bigint(10) unsigned NOT NULL default '0',
<   `lockedseen` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   UNIQUE KEY `mdl_wikilock_wikpag_uix` (`wikiid`,`pagename`),
<   KEY `mdl_wikilock_loc_ix` (`lockedseen`),
<   KEY `mdl_wikilock_wik_ix` (`wikiid`)
< ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Stores editing locks on Wiki pages';
---
>   `lockedby` int(10) NOT NULL default '0',
>   `lockedsince` int(10) NOT NULL default '0',
>   `lockedseen` int(10) NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   UNIQUE KEY `wiki_locks_uk` (`wikiid`,`pagename`),
>   KEY `wiki_locks_ix` (`lockedseen`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4593,4596c4577,4580
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `pagename` varchar(160) collate utf8_unicode_ci NOT NULL default '',
<   `version` bigint(10) unsigned NOT NULL default '0',
<   `flags` bigint(10) unsigned default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `pagename` varchar(160) collate utf8_unicode_ci NOT NULL,
>   `version` int(10) unsigned NOT NULL default '0',
>   `flags` int(10) unsigned default '0',
4599,4601c4583,4585
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `created` bigint(10) unsigned default '0',
<   `lastmodified` bigint(10) unsigned default '0',
---
>   `userid` int(10) unsigned NOT NULL default '0',
>   `created` int(10) unsigned default '0',
>   `lastmodified` int(10) unsigned default '0',
4604,4605c4588,4589
<   `hits` bigint(10) unsigned default '0',
<   `wiki` bigint(10) unsigned NOT NULL default '0',
---
>   `hits` int(10) unsigned default '0',
>   `wiki` int(10) unsigned NOT NULL default '0',
4607,4608c4591
<   UNIQUE KEY `mdl_wikipage_pagverwik_uix` (`pagename`,`version`,`wiki`),
<   KEY `mdl_wikipage_wik_ix` (`wiki`)
---
>   UNIQUE KEY `wiki_pages_uk` (`pagename`,`version`,`wiki`)
4626,4627c4609,4610
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `course` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `course` int(10) unsigned NOT NULL default '0',
4630,4632c4613,4615
<   `wtype` smallint(3) unsigned NOT NULL default '0',
<   `nelements` smallint(3) unsigned NOT NULL default '1',
<   `nattachments` smallint(3) unsigned NOT NULL default '0',
---
>   `wtype` tinyint(3) unsigned NOT NULL default '0',
>   `nelements` tinyint(3) unsigned NOT NULL default '1',
>   `nattachments` tinyint(3) unsigned NOT NULL default '0',
4641,4656c4624,4639
<   `maxbytes` bigint(10) unsigned NOT NULL default '100000',
<   `submissionstart` bigint(10) unsigned NOT NULL default '0',
<   `assessmentstart` bigint(10) unsigned NOT NULL default '0',
<   `submissionend` bigint(10) unsigned NOT NULL default '0',
<   `assessmentend` bigint(10) unsigned NOT NULL default '0',
<   `releasegrades` bigint(10) unsigned NOT NULL default '0',
<   `grade` smallint(3) NOT NULL default '0',
<   `gradinggrade` smallint(3) NOT NULL default '0',
<   `ntassessments` smallint(3) unsigned NOT NULL default '0',
<   `assessmentcomps` smallint(3) unsigned NOT NULL default '2',
<   `nsassessments` smallint(3) unsigned NOT NULL default '0',
<   `overallocation` smallint(3) unsigned NOT NULL default '0',
<   `timemodified` bigint(10) unsigned NOT NULL default '0',
<   `teacherweight` smallint(3) unsigned NOT NULL default '1',
<   `showleaguetable` smallint(3) unsigned NOT NULL default '0',
<   `usepassword` smallint(3) unsigned NOT NULL default '0',
---
>   `maxbytes` int(10) unsigned NOT NULL default '100000',
>   `submissionstart` int(10) unsigned NOT NULL default '0',
>   `assessmentstart` int(10) unsigned NOT NULL default '0',
>   `submissionend` int(10) unsigned NOT NULL default '0',
>   `assessmentend` int(10) unsigned NOT NULL default '0',
>   `releasegrades` int(10) unsigned NOT NULL default '0',
>   `grade` tinyint(3) NOT NULL default '0',
>   `gradinggrade` tinyint(3) NOT NULL default '0',
>   `ntassessments` tinyint(3) unsigned NOT NULL default '0',
>   `assessmentcomps` tinyint(3) unsigned NOT NULL default '2',
>   `nsassessments` tinyint(3) unsigned NOT NULL default '0',
>   `overallocation` tinyint(3) unsigned NOT NULL default '0',
>   `timemodified` int(10) unsigned NOT NULL default '0',
>   `teacherweight` tinyint(3) unsigned NOT NULL default '1',
>   `showleaguetable` tinyint(3) unsigned NOT NULL default '0',
>   `usepassword` tinyint(3) unsigned NOT NULL default '0',
4659c4642
<   KEY `mdl_work_cou_ix` (`course`)
---
>   KEY `course` (`course`)
4677,4689c4660,4672
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `workshopid` bigint(10) unsigned NOT NULL default '0',
<   `submissionid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
<   `timegraded` bigint(10) unsigned NOT NULL default '0',
<   `timeagreed` bigint(10) unsigned NOT NULL default '0',
<   `grade` double NOT NULL default '0',
<   `gradinggrade` smallint(3) NOT NULL default '0',
<   `teachergraded` smallint(3) unsigned NOT NULL default '0',
<   `mailed` smallint(3) unsigned NOT NULL default '0',
<   `resubmission` smallint(3) unsigned NOT NULL default '0',
<   `donotuse` smallint(3) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `workshopid` int(10) unsigned NOT NULL default '0',
>   `submissionid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
>   `timegraded` int(10) unsigned NOT NULL default '0',
>   `timeagreed` int(10) unsigned NOT NULL default '0',
>   `grade` float NOT NULL default '0',
>   `gradinggrade` int(3) NOT NULL default '0',
>   `teachergraded` int(4) unsigned NOT NULL default '0',
>   `mailed` tinyint(3) unsigned NOT NULL default '0',
>   `resubmission` tinyint(3) unsigned NOT NULL default '0',
>   `donotuse` tinyint(3) unsigned NOT NULL default '0',
4693,4696c4676,4679
<   KEY `mdl_workasse_use_ix` (`userid`),
<   KEY `mdl_workasse_mai_ix` (`mailed`),
<   KEY `mdl_workasse_wor_ix` (`workshopid`),
<   KEY `mdl_workasse_sub_ix` (`submissionid`)
---
>   KEY `submissionid` (`submissionid`),
>   KEY `userid` (`userid`),
>   KEY `workshopid` (`workshopid`),
>   KEY `mailed` (`mailed`)
4714,4718c4697,4701
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `workshopid` bigint(10) unsigned NOT NULL default '0',
<   `assessmentid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `workshopid` int(10) unsigned NOT NULL default '0',
>   `assessmentid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
>   `timecreated` int(10) unsigned NOT NULL default '0',
4722,4725c4705,4708
<   KEY `mdl_workcomm_use_ix` (`userid`),
<   KEY `mdl_workcomm_mai_ix` (`mailed`),
<   KEY `mdl_workcomm_wor_ix` (`workshopid`),
<   KEY `mdl_workcomm_ass_ix` (`assessmentid`)
---
>   KEY `workshopid` (`workshopid`),
>   KEY `assessmentid` (`assessmentid`),
>   KEY `userid` (`userid`),
>   KEY `mailed` (`mailed`)
4743,4745c4726,4728
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `workshopid` bigint(10) unsigned NOT NULL default '0',
<   `elementno` smallint(3) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `workshopid` int(10) unsigned NOT NULL default '0',
>   `elementno` tinyint(3) unsigned NOT NULL default '0',
4747,4751c4730,4734
<   `scale` smallint(3) unsigned NOT NULL default '0',
<   `maxscore` smallint(3) unsigned NOT NULL default '1',
<   `weight` smallint(3) unsigned NOT NULL default '11',
<   `stddev` double NOT NULL default '0',
<   `totalassessments` bigint(10) NOT NULL default '0',
---
>   `scale` tinyint(3) unsigned NOT NULL default '0',
>   `maxscore` tinyint(3) unsigned NOT NULL default '1',
>   `weight` tinyint(3) unsigned NOT NULL default '11',
>   `stddev` float NOT NULL default '0',
>   `totalassessments` int(10) NOT NULL default '0',
4753c4736
<   KEY `mdl_workelem_wor_ix` (`workshopid`)
---
>   KEY `workshopid` (`workshopid`)
4771,4774c4754,4757
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `workshopid` bigint(10) unsigned NOT NULL default '0',
<   `assessmentid` bigint(10) unsigned NOT NULL default '0',
<   `elementno` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `workshopid` int(10) unsigned NOT NULL default '0',
>   `assessmentid` int(10) unsigned NOT NULL default '0',
>   `elementno` int(10) unsigned NOT NULL default '0',
4776c4759
<   `grade` smallint(3) NOT NULL default '0',
---
>   `grade` tinyint(3) NOT NULL default '0',
4778,4779c4761,4762
<   KEY `mdl_workgrad_wor_ix` (`workshopid`),
<   KEY `mdl_workgrad_ass_ix` (`assessmentid`)
---
>   KEY `assessmentid` (`assessmentid`),
>   KEY `workshopid` (`workshopid`)
4797,4800c4780,4783
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `workshopid` bigint(10) unsigned NOT NULL default '0',
<   `elementno` bigint(10) unsigned NOT NULL default '0',
<   `rubricno` smallint(3) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `workshopid` int(10) unsigned NOT NULL default '0',
>   `elementno` int(10) unsigned NOT NULL default '0',
>   `rubricno` tinyint(3) unsigned NOT NULL default '0',
4802,4803c4785
<   PRIMARY KEY  (`id`),
<   KEY `mdl_workrubr_wor_ix` (`workshopid`)
---
>   PRIMARY KEY  (`id`)
4821,4823c4803,4805
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `workshopid` bigint(10) unsigned NOT NULL default '0',
<   `elementno` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `workshopid` int(10) unsigned NOT NULL default '0',
>   `elementno` int(10) unsigned NOT NULL default '0',
4825,4826c4807
<   PRIMARY KEY  (`id`),
<   KEY `mdl_workstoc_wor_ix` (`workshopid`)
---
>   PRIMARY KEY  (`id`)
4844,4846c4825,4827
<   `id` bigint(10) unsigned NOT NULL auto_increment,
<   `workshopid` bigint(10) unsigned NOT NULL default '0',
<   `userid` bigint(10) unsigned NOT NULL default '0',
---
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `workshopid` int(10) unsigned NOT NULL default '0',
>   `userid` int(10) unsigned NOT NULL default '0',
4848c4829
<   `timecreated` bigint(10) unsigned NOT NULL default '0',
---
>   `timecreated` int(10) unsigned NOT NULL default '0',
4851,4858c4832,4839
<   `gradinggrade` smallint(3) unsigned NOT NULL default '0',
<   `finalgrade` smallint(3) unsigned NOT NULL default '0',
<   `late` smallint(3) unsigned NOT NULL default '0',
<   `nassessments` bigint(10) unsigned NOT NULL default '0',
<   PRIMARY KEY  (`id`),
<   KEY `mdl_worksubm_use_ix` (`userid`),
<   KEY `mdl_worksubm_mai_ix` (`mailed`),
<   KEY `mdl_worksubm_wor_ix` (`workshopid`)
---
>   `gradinggrade` int(3) unsigned NOT NULL default '0',
>   `finalgrade` int(3) unsigned NOT NULL default '0',
>   `late` int(3) unsigned NOT NULL default '0',
>   `nassessments` int(10) unsigned NOT NULL default '0',
>   PRIMARY KEY  (`id`),
>   KEY `userid` (`userid`),
>   KEY `workshopid` (`workshopid`),
>   KEY `mailed` (`mailed`)
