'4' ){ require_once( 'php/db/MySQLi_class.php' ); $DATABASE = new MySQLi_DB($DBHost, $DBName, $DBUser, $DBPassword); } else { echo "CANNOT DETERMINE DATABASE ENGINE!!!!!!!\n\n"; exit(); }; $QS="SHOW INDEX FROM `modbus_modules` WHERE Column_name='platform_id'"; $R = $DATABASE->Query( $QS ); if( count( $R ) ){ $QS = "ALTER TABLE `modbus_modules` DROP INDEX `{$R[0]['Key_name']}`"; $UPGRADE = true; $DATABASE->Query( $QS ); }; $QS = "SHOW COLUMNS FROM `modbus_modules` LIKE 'label'"; $R = $DATABASE->Query( $QS ); if( count( $R ) == 0 ){ $QS = "ALTER TABLE `modbus_modules` ADD `label` CHAR(32) DEFAULT ''"; $UPGRADE = true; $DATABASE->Query( $QS ); }; $QS = "SHOW COLUMNS FROM `metro_stations` LIKE 'short'"; $R = $DATABASE->Query( $QS ); if( count( $R ) == 0 ){ $QS = "ALTER TABLE `metro_stations` ADD `short` CHAR(32) DEFAULT ''"; $UPGRADE = true; $DATABASE->Query( $QS ); }; $QS = "SHOW TABLES LIKE 'session_composer_queue'"; $R = $DATABASE->Query( $QS ); if( count( $R ) ){ $QS = "ALTER TABLE `session_composer_queue` RENAME TO `media_composer_queue`"; $UPGRADE = true; $DATABASE->Query( $QS ); }; $QS = "SHOW TABLES LIKE 'media_composer_queue'"; $R = $DATABASE->Query( $QS ); if( count( $R ) == 0 ){ $QS =<<Query( $QS ); }; $QS = "SHOW TABLES LIKE 'media_encoder_queue'"; $R = $DATABASE->Query( $QS ); if( count( $R ) == 0 ){ $QS = "ALTER TABLE `media_queue` RENAME TO `media_encoder_queue`"; $UPGRADE = true; $DATABASE->Query( $QS ); }; $QS = "SELECT * FROM `session_statuses` WHERE `lvl`=1"; $R = $DATABASE->Query( $QS ); if( count( $R ) == 0 ){ $QS = "INSERT INTO `session_statuses`(`lvl`,`label`,`min_access`,`class`) VALUES(1,'Dismiss by Station',3,'active_yellow')"; $DATABASE->Query( $QS ); }; if( $UPGRADE ){ echo "Upgrade Done!\n\n"; } else { echo "No Upgrade Needed!\n\n"; }; ?>