diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-03-17 05:47:07 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-03-17 05:47:07 +0000 |
commit | 0a401c7ca475c0e65bbdd9212f1b6a439239c94e (patch) | |
tree | 4b10e4a0e212d82fd0d4e01af4a0bb438ca9794e /lib/class | |
parent | 629efec5fa1a55f9284fa8acdc3333b442e9635e (diff) | |
download | ampache-0a401c7ca475c0e65bbdd9212f1b6a439239c94e.tar.gz ampache-0a401c7ca475c0e65bbdd9212f1b6a439239c94e.tar.bz2 ampache-0a401c7ca475c0e65bbdd9212f1b6a439239c94e.zip |
updated sql files, tweak to the update and installers to make it more utf-8ish hopefully final commit before release
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/update.class.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/class/update.class.php b/lib/class/update.class.php index 7127f1d5..291c26e8 100644 --- a/lib/class/update.class.php +++ b/lib/class/update.class.php @@ -1143,9 +1143,29 @@ class Update { $sql = "ALTER TABLE `playlist` ADD `date` INT ( 11 ) UNSIGNED NOT NULL"; $db_results = Dba::query($sql); - $sql = "ALTER TABLE `rating` CHANGE `rating` TINYINT ( 4 ) NOT NULL"; + // Pull all of the rating information + $sql = "SELECT `id`,`rating` FROM `rating`"; $db_results = Dba::query($sql); + $results = array(); + + while ($row = Dba::fetch_assoc($db_results)) { + $results[] = $row; + } + + $sql = "ALTER TABLE `rating` DROP `rating`"; + $db_results = Dba::query($sql); + + $sql = "ALTER TABLE `rating` ADD `rating` TINYINT ( 4 ) NOT NULL"; + $db_results = Dba::query($sql); + + foreach ($results as $row) { + $rating = Dba::escape($row['rating']); + $id = Dba::escape($row['id']); + $sql = "UPDATE `rating` SET `rating`='$rating' WHERE `id`='$id'"; + $db_results = Dba::query($sql); + } + self::set_version('db_version','340015'); } // update_340015 |