From 68aca7623155d1a8365e098e1fa738582dd0d1bc Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Thu, 4 Feb 2010 23:56:18 +0000 Subject: Add AmpacheAPI external, start work on future db changes --- lib/class/update.class.php | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'lib/class/update.class.php') diff --git a/lib/class/update.class.php b/lib/class/update.class.php index 25bbc215..106c3480 100644 --- a/lib/class/update.class.php +++ b/lib/class/update.class.php @@ -1795,9 +1795,48 @@ class Update { self::set_version('db_version','360001'); - } // update_360001 + /** + * update_360002 + * This update makes changes to the cataloging to accomodate the new method for syncing between + * Ampache instances, could be adapted to sync with whatever for "full" catalog + */ + public static function update_360002() { + + // Drop the key from catalog and ACL + $sql = "ALTER TABLE `catalog` DROP `key`"; + $db_results = Dba::write($sql); + + $sql = "ALTER TABLE `access_list` DROP `key`"; + $db_results = Dba::write($sql); + + // Add in Username / Password for catalog - to be used for remote catalogs + $sql = "ALTER TABLE `catalog` ADD `remote_username` VARCHAR ( 255 ) AFTER `user`"; + $db_results = Dba::write($sql); + + $sql = "ALTER TABLE `catalog` ADD `remote_password` VARCHAR ( 255 ) AFTER `remote_username`"; + $db_results = Dba::write($sql); + + // Adjust the Filename field in song, make it gi-normous. If someone has anything close to + // this file length, they seriously need to reconsider what they are doing. + $sql = "ALTER TABLE `song` CHANGE `file` `file` VARCHAR ( 4096 )"; + $db_results = Dba::write($sql); + + $sql = "ALTER TABLE `video` CHANGE `file` `file` VARCHAR ( 4096 )"; + $db_results = Dba::write($sql); + + $sql = "ALTER TABLE `live_stream` CHANGE `url` `url` VARCHAR ( 4096 )"; + $db_results = Dba::write($sql); + + User::fix_preferences('-1'); + + while ($r = Dba::fetch_assoc($db_results)) { + User::fix_preferences($r['id']); + } // while we're fixing the useres stuff + + } // update_360002 + } // end update class ?> -- cgit