Moving from lastIP to lastip everywhere. Bug 5763.

(http://moodle.org/bugs/bug.php?op=show&bugid=5763)

Merged (more or less) from MOODLE_16_STABLE
This commit is contained in:
stronk7 2006-06-09 09:47:01 +00:00
parent c766b9dfaa
commit d836482a34
5 changed files with 22 additions and 3 deletions

View File

@ -1983,6 +1983,15 @@ function main_upgrade($oldversion=0) {
execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report stats', 'course', 'fullname')");
}
}
//Renaming lastIP to lastip (all fields lowercase)
if ($oldversion < 2006060900) {
//Only if it exists
$fields = $db->MetaColumnNames($CFG->prefix.'user');
if (in_array('lastIP',$fields)) {
table_column("user", "lastIP", "lastip", "varchar", "15", "", "", "not null", "currentlogin");
}
}
return $result;
}

View File

@ -609,7 +609,7 @@ CREATE TABLE `prefix_user` (
`lastaccess` int(10) unsigned NOT NULL default '0',
`lastlogin` int(10) unsigned NOT NULL default '0',
`currentlogin` int(10) unsigned NOT NULL default '0',
`lastIP` varchar(15) NOT NULL default '',
`lastip` varchar(15) NOT NULL default '',
`secret` varchar(15) NOT NULL default '',
`picture` tinyint(1) NOT NULL default '0',
`url` varchar(255) NOT NULL default '',

View File

@ -1611,6 +1611,16 @@ function main_upgrade($oldversion=0) {
}
}
//Renaming lastIP to lastip (all fields lowercase)
if ($oldversion < 2006060900) {
//Not needed unded PG because it stores fieldnames lowecase by default
//Only if it exists (because MOODLE_16_STABLE could have done this work before. Bug 5763)
//$fields = $db->MetaColumnNames($CFG->prefix.'user');
//if (in_array('lastIP',$fields)) {
// table_column("user", "lastIP", "lastip", "varchar", "15", "", "", "", "currentlogin");
//}
}
return $result;
}

View File

@ -428,7 +428,7 @@ CREATE TABLE prefix_user (
lastaccess integer NOT NULL default '0',
lastlogin integer NOT NULL default '0',
currentlogin integer NOT NULL default '0',
lastIP varchar(15) default NULL,
lastip varchar(15) default NULL,
secret varchar(15) default NULL,
picture integer default NULL,
url varchar(255) default NULL,

View File

@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
$version = 2006060400; // YYYYMMDD = date
$version = 2006060900; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.7 dev'; // Human-friendly version name