From 68c0264e1bd3b22bd771b7e5228c0a192ccc1fa3 Mon Sep 17 00:00:00 2001 From: defacer Date: Fri, 8 Apr 2005 19:50:01 +0000 Subject: [PATCH] Changes to mdl_user: * Change timezone to varchar(100) (to support non-trivial timezones) * Drop timezonename (will not be used after all) --- lib/db/mysql.php | 5 +++++ lib/db/mysql.sql | 3 +-- lib/db/postgres7.php | 5 +++++ lib/db/postgres7.sql | 3 +-- version.php | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 89aa164a05b..74a1818432b 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -1318,6 +1318,11 @@ function main_upgrade($oldversion=0) { execute_sql('ALTER TABLE `'.$CFG->prefix.'course_modules` DROP `deleted`'); // Old field } + if ($oldversion < 2005040800) { + table_column('user', 'timezone', 'timezone', 'varchar', '100', '', '99'); + execute_sql(" ALTER TABLE `{$CFG->prefix}user` DROP `timezonename` "); + } + return $result; } diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index b3598da4d8f..40d0bdc6355 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -536,8 +536,7 @@ CREATE TABLE `prefix_user` ( `country` char(2) default NULL, `lang` varchar(10) default 'en', `theme` varchar(50) NOT NULL default '', - `timezone` float NOT NULL default '99', - `timezonename` varchar(100) NOT NULL default '', + `timezone` varchar(100) NOT NULL default '99', `firstaccess` int(10) unsigned NOT NULL default '0', `lastaccess` int(10) unsigned NOT NULL default '0', `lastlogin` int(10) unsigned NOT NULL default '0', diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index fad9617d262..a0fc2645ac3 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -1034,6 +1034,11 @@ function main_upgrade($oldversion=0) { execute_sql('ALTER TABLE '.$CFG->prefix.'course_modules DROP deleted;'); // Old field } + if ($oldversion < 2005040800) { + table_column('user', 'timezone', 'timezone', 'varchar', '100', '', '99'); + execute_sql(" ALTER TABLE `{$CFG->prefix}user` DROP `timezonename` "); + } + return $result; } diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index ed4505462ef..751c9064ab7 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -374,8 +374,7 @@ CREATE TABLE prefix_user ( country char(2) default NULL, lang varchar(10) NOT NULL default '', theme varchar(50) NOT NULL default '', - timezone float NOT NULL default '99', - timezonename varchar(100) NOT NULL default '', + timezone varchar(100) NOT NULL default '99', firstaccess integer NOT NULL default '0', lastaccess integer NOT NULL default '0', lastlogin integer NOT NULL default '0', diff --git a/version.php b/version.php index 107a4311db6..cb0f59dc1b8 100644 --- a/version.php +++ b/version.php @@ -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 = 2005033100; // YYYYMMDD = date + $version = 2005040800; // YYYYMMDD = date // XY = increments within a single day $release = '1.5 UNSTABLE DEVELOPMENT'; // Human-friendly version name