1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-06 03:49:56 +02:00

updated sql files, tweak to the update and installers to make it more utf-8ish hopefully final commit before release

This commit is contained in:
Karl 'vollmerk' Vollmer 2008-03-17 05:47:07 +00:00
parent 629efec5fa
commit 0a401c7ca4
7 changed files with 260 additions and 82 deletions

View file

@ -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