changed some int(11) to int(10)

This commit is contained in:
toyomoyo 2006-04-10 06:26:07 +00:00
parent 16ae46f6c5
commit dffaf68202
2 changed files with 53 additions and 32 deletions

View file

@ -1682,18 +1682,18 @@ function main_upgrade($oldversion=0) {
if ($oldversion < 2006031000) { if ($oldversion < 2006031000) {
modify_database("","CREATE TABLE prefix_post ( modify_database("","CREATE TABLE prefix_post (
`id` int(11) NOT NULL auto_increment, `id` int(10) NOT NULL auto_increment,
`userid` int(11) NOT NULL default '0', `userid` int(10) NOT NULL default '0',
`courseid` int(11) NOT NULL default'0', `courseid` int(10) NOT NULL default'0',
`groupid` int(11) NOT NULL default'0', `groupid` int(10) NOT NULL default'0',
`moduleid` int(11) NOT NULL default'0', `moduleid` int(10) NOT NULL default'0',
`coursemoduleid` int(11) NOT NULL default'0', `coursemoduleid` int(10) NOT NULL default'0',
`subject` varchar(128) NOT NULL default '', `subject` varchar(128) NOT NULL default '',
`summary` longtext, `summary` longtext,
`content` longtext, `content` longtext,
`uniquehash` varchar(128) NOT NULL default '', `uniquehash` varchar(128) NOT NULL default '',
`rating` int(11) NOT NULL default'0', `rating` int(10) NOT NULL default'0',
`format` int(11) NOT NULL default'0', `format` int(10) NOT NULL default'0',
`publishstate` enum('draft','site','public') NOT NULL default 'draft', `publishstate` enum('draft','site','public') NOT NULL default 'draft',
`lastmodified` int(10) NOT NULL default '0', `lastmodified` int(10) NOT NULL default '0',
`created` int(10) NOT NULL default '0', `created` int(10) NOT NULL default '0',
@ -1704,20 +1704,20 @@ function main_upgrade($oldversion=0) {
) TYPE=MyISAM COMMENT='New moodle post table. Holds data posts such as forum entries or blog entries.';"); ) TYPE=MyISAM COMMENT='New moodle post table. Holds data posts such as forum entries or blog entries.';");
modify_database("","CREATE TABLE prefix_tags ( modify_database("","CREATE TABLE prefix_tags (
`id` int(11) NOT NULL auto_increment, `id` int(10) NOT NULL auto_increment,
`type` varchar(255) NOT NULL default 'official', `type` varchar(255) NOT NULL default 'official',
`userid` int(11) NOT NULL default'0', `userid` int(10) NOT NULL default'0',
`text` varchar(255) NOT NULL default '', `text` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT ='tags structure for moodle.';"); ) TYPE=MyISAM COMMENT ='tags structure for moodle.';");
modify_database("","CREATE TABLE prefix_blog_tag_instance ( modify_database("","CREATE TABLE prefix_blog_tag_instance (
`id` int(11) NOT NULL auto_increment, `id` int(10) NOT NULL auto_increment,
`entryid` int(11) NOT NULL default'0', `entryid` int(10) NOT NULL default'0',
`tagid` int(11) NOT NULL default'0', `tagid` int(10) NOT NULL default'0',
`groupid` int(11) NOT NULL default'0', `groupid` int(10) NOT NULL default'0',
`courseid` int(11) NOT NULL default'0', `courseid` int(10) NOT NULL default'0',
`userid` int(11) NOT NULL default'0', `userid` int(10) NOT NULL default'0',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT ='tag instance for blogs.';"); ) TYPE=MyISAM COMMENT ='tag instance for blogs.';");
} }
@ -1751,6 +1751,27 @@ function main_upgrade($oldversion=0) {
execute_sql(" CREATE INDEX coursesection ON {$CFG->prefix}course_sections (course,section) ", false); execute_sql(" CREATE INDEX coursesection ON {$CFG->prefix}course_sections (course,section) ", false);
} }
/// change all the int(11) to int(10) for blogs and tags
if ($oldversion < 2006041000) {
table_column('post','id','id','integer','10','unsigned','0','not null');
table_column('post','userid','userid','integer','10','unsigned','0','not null');
table_column('post','courseid','courseid','integer','10','unsigned','0','not null');
table_column('post','groupid','groupid','integer','10','unsigned','0','not null');
table_column('post','moduleid','moduleid','integer','10','unsigned','0','not null');
table_column('post','coursemoduleid','coursemoduleid','integer','10','unsigned','0','not null');
table_column('post','rating','rating','integer','10','unsigned','0','not null');
table_column('post','format','format','integer','10','unsigned','0','not null');
table_column('tags','id','id','integer','10','unsigned','0','not null');
table_column('tags','userid','userid','integer','10','unsigned','0','not null');
table_column('blog_tag_instance','id','id','integer','10','unsigned','0','not null');
table_column('blog_tag_instance','entryid','entryid','integer','10','unsigned','0','not null');
table_column('blog_tag_instance','tagid','tagid','integer','10','unsigned','0','not null');
table_column('blog_tag_instance','groupid','groupid','integer','10','unsigned','0','not null');
table_column('blog_tag_instance','courseid','courseid','integer','10','unsigned','0','not null');
table_column('blog_tag_instance','userid','userid','integer','10','unsigned','0','not null');
}
return $result; return $result;
} }

View file

@ -846,19 +846,19 @@ CREATE TABLE prefix_stats_user_monthly (
# Table structure for table `prefix_post` # Table structure for table `prefix_post`
# #
CREATE TABLE prefix_post ( CREATE TABLE prefix_post (
`id` int(11) NOT NULL auto_increment, `id` int(10) NOT NULL auto_increment,
`module` varchar(20) NOT NULL default '', `module` varchar(20) NOT NULL default '',
`userid` int(11) NOT NULL default '0', `userid` int(10) NOT NULL default '0',
`courseid` int(11) NOT NULL default '0', `courseid` int(10) NOT NULL default '0',
`groupid` int(11) NOT NULL default '0', `groupid` int(10) NOT NULL default '0',
`moduleid` int(11) NOT NULL default '0', `moduleid` int(10) NOT NULL default '0',
`coursemoduleid` int(11) NOT NULL default '0', `coursemoduleid` int(10) NOT NULL default '0',
`subject` varchar(128) NOT NULL default '', `subject` varchar(128) NOT NULL default '',
`summary` longtext, `summary` longtext,
`content` longtext, `content` longtext,
`uniquehash` varchar(128) NOT NULL default '', `uniquehash` varchar(128) NOT NULL default '',
`rating` int(11) NOT NULL default '0', `rating` int(10) NOT NULL default '0',
`format` int(11) NOT NULL default '0', `format` int(10) NOT NULL default '0',
`publishstate` enum('draft','site','public') NOT NULL default 'draft', `publishstate` enum('draft','site','public') NOT NULL default 'draft',
`lastmodified` int(10) NOT NULL default '0', `lastmodified` int(10) NOT NULL default '0',
`created` int(10) NOT NULL default '0', `created` int(10) NOT NULL default '0',
@ -872,21 +872,21 @@ CREATE TABLE prefix_post (
# tags are not limited to blogs # tags are not limited to blogs
CREATE TABLE prefix_tags ( CREATE TABLE prefix_tags (
`id` int(11) NOT NULL auto_increment, `id` int(10) NOT NULL auto_increment,
`type` varchar(255) NOT NULL default 'official', `type` varchar(255) NOT NULL default 'official',
`userid` int(11) NOT NULL default '0', `userid` int(10) NOT NULL default '0',
`text` varchar(255) NOT NULL default '', `text` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT ='tags structure for moodle.'; ) TYPE=MyISAM COMMENT ='tags structure for moodle.';
# instance of a tag for a blog # instance of a tag for a blog
CREATE TABLE prefix_blog_tag_instance ( CREATE TABLE prefix_blog_tag_instance (
`id` int(11) NOT NULL auto_increment, `id` int(10) NOT NULL auto_increment,
`entryid` int(11) NOT NULL default '0', `entryid` int(10) NOT NULL default '0',
`tagid` int(11) NOT NULL default '0', `tagid` int(10) NOT NULL default '0',
`groupid` int(11) NOT NULL default '0', `groupid` int(10) NOT NULL default '0',
`courseid` int(11) NOT NULL default '0', `courseid` int(10) NOT NULL default '0',
`userid` int(11) NOT NULL default '0', `userid` int(10) NOT NULL default '0',
`timemodified` int(10) unsigned NOT NULL default '0', `timemodified` int(10) unsigned NOT NULL default '0',
KEY `bti_entryid_idx` (`entryid`), KEY `bti_entryid_idx` (`entryid`),
KEY `bti_tagid_idx` (`tagid`), KEY `bti_tagid_idx` (`tagid`),