summaryrefslogtreecommitdiffstats
path: root/lib/class/update.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-09 07:49:59 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-09 07:49:59 +0000
commitc5d6e04d114d3c4b3f31743ccd0d4a60c9ef9632 (patch)
treebc3196cb97d63079013ebfc5b183d2038ee7c9e7 /lib/class/update.class.php
parentc9170314af9139abef87629d218c7999bd3c8df3 (diff)
downloadampache-c5d6e04d114d3c4b3f31743ccd0d4a60c9ef9632.tar.gz
ampache-c5d6e04d114d3c4b3f31743ccd0d4a60c9ef9632.tar.bz2
ampache-c5d6e04d114d3c4b3f31743ccd0d4a60c9ef9632.zip
removed ID field from user table, and everything that goes with that...
Diffstat (limited to 'lib/class/update.class.php')
-rw-r--r--lib/class/update.class.php26
1 files changed, 19 insertions, 7 deletions
diff --git a/lib/class/update.class.php b/lib/class/update.class.php
index 5612eb0d..f077daef 100644
--- a/lib/class/update.class.php
+++ b/lib/class/update.class.php
@@ -229,13 +229,13 @@ class Update {
$version[] = array('version' => '332001', 'description' => $update_string);
- return $version;
-
$update_string = "- Removed every Instance of User->ID *Note* This update clears Now Playing.<br />" .
"- Added field allowing for Dynamic Playlists.<br />" .
"- Added required table/fields for security related IP Tracking.<br />";
- //$version[] = array('version' => '332002', 'description' => $update_string);
+ $version[] = array('version' => '332002', 'description' => $update_string);
+
+ return $version;
} // populate_version
@@ -960,8 +960,18 @@ class Update {
function update_332002() {
-// $sql = "CREATE TABLE `ip_history` (`username` VARCHAR(128), `ip` INT(11) UNSIGNED NOT NULL DEFAULT '0', " .
-// "`connections` INT(11) UNSIGNED NOT NULL DEFAULT '1', `date` INT(11) UNSIGNED NOT NULL DEFAULT '0')";
+ $sql = "CREATE TABLE `ip_history` (`username` VARCHAR(128), `ip` INT(11) UNSIGNED NOT NULL DEFAULT '0', " .
+ "`connections` INT(11) UNSIGNED NOT NULL DEFAULT '1', `date` INT(11) UNSIGNED NOT NULL DEFAULT '0')";
+ $db_results = mysql_query($sql, dbh());
+
+ $sql = "ALTER TABLE `ip_history` ADD INDEX ( `username` )";
+ $db_results = mysql_query($sql, dbh());
+
+ $sql = "ALTER TABLE `ip_history` ADD INDEX ( `date` )";
+ $db_results = mysql_query($sql, dbh());
+
+ $sql = "ALTER TABLE `session` ADD `ip` INT( 11 ) UNSIGNED AFTER `value`";
+ $db_results = mysql_query($sql, dbh());
$sql = "ALTER TABLE `object_count` CHANGE `object_type` `object_type` ENUM( 'album', 'artist', 'song', 'playlist', 'genre', 'catalog' ) NOT NULL DEFAULT 'song'";
$db_results = mysql_query($sql, dbh());
@@ -982,10 +992,10 @@ class Update {
}
/* It's time for some serious DB Clean Up. Nuke this stuff from Orbit! */
- $sql = "ALTER TABLE `catalog DROP `private`";
+ $sql = "ALTER TABLE `catalog` DROP `private`";
$db_results = mysql_query($sql, dbh());
- $sql = "ALTER TABLE `catalog` CHANGE `enabled` `enabled` TINYINT UNSIGNED NOT NULL DEFAULT '1'";
+ $sql = "ALTER TABLE `catalog` CHANGE `enabled` `enabled` TINYINT ( 1 ) UNSIGNED NOT NULL DEFAULT '1'";
$db_results = mysql_query($sql, dbh());
/*
@@ -1158,6 +1168,8 @@ class Update {
$sql = "ALTER TABLE `user` DROP `id`";
$db_results = mysql_query($sql, dbh());
+ $this->set_version('db_version', '332002');
+
} // update_332002