##----------------------------------------------------------------------------------#
 # MusicMiner Web Server															#
 # Name:		source/app/sql/upgrade_1-0-5_to_1-0-6.sql							#
 # Author:		Jesse J Morrow	(jesse@jessejmorrow.com)							#
 # Created:		2008-09-30															#
 # Updated:		2008-12-02															#
 # Compat:		MySQL 5																#
 # Copyright:	Copyright 2008 Soundminer Inc.										#
 # Purpose:		Upgrade the installed MusicMiner databases.							#
 # Version:		1.0.5 to 1.0.6														#
 #----------------------------------------------------------------------------------##

# Fill in `db_id` and `track_id` fields of `log_downloads` to fix effects of bug in 1.0.5
UPDATE `mm_admin`.`log_downloads`, `mm_admin`.`assets` SET `log_downloads`.`db_id` = `assets`.`db_id`, `log_downloads`.`track_id` = `assets`.`track_id` WHERE `log_downloads`.`asset_id` = `assets`.`id`;

# Update version fields
UPDATE `mm_admin`.`schema` SET `db_ver` = '1.0.6';