mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Delete some obsolete tables
This commit is contained in:
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/sql/core_sql.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/sql/core_sql.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:33:33 $
|
| $Date: 2007-09-22 20:32:31 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
header("location:../index.php");
|
header("location:../index.php");
|
||||||
@@ -192,34 +192,6 @@ CREATE TABLE download_requests (
|
|||||||
) TYPE=MyISAM;
|
) TYPE=MyISAM;
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Table structure for table `flood`
|
|
||||||
#
|
|
||||||
|
|
||||||
CREATE TABLE flood (
|
|
||||||
flood_url text NOT NULL,
|
|
||||||
flood_time int(10) unsigned NOT NULL default '0'
|
|
||||||
) TYPE=MyISAM;
|
|
||||||
# --------------------------------------------------------
|
|
||||||
|
|
||||||
#
|
|
||||||
# Table structure for table `headlines`
|
|
||||||
#
|
|
||||||
|
|
||||||
CREATE TABLE headlines (
|
|
||||||
headline_id int(10) unsigned NOT NULL auto_increment,
|
|
||||||
headline_url varchar(150) NOT NULL default '',
|
|
||||||
headline_data text NOT NULL,
|
|
||||||
headline_timestamp int(10) unsigned NOT NULL default '0',
|
|
||||||
headline_description text NOT NULL,
|
|
||||||
headline_image varchar(100) NOT NULL default '',
|
|
||||||
headline_active tinyint(1) unsigned NOT NULL default '0',
|
|
||||||
PRIMARY KEY (headline_id)
|
|
||||||
) TYPE=MyISAM;
|
|
||||||
|
|
||||||
# --------------------------------------------------------
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Table structure for table `links`
|
# Table structure for table `links`
|
||||||
#
|
#
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
|
||||||
| $Revision: 1.8 $
|
| $Revision: 1.9 $
|
||||||
| $Date: 2007-06-24 16:18:48 $
|
| $Date: 2007-09-22 20:32:31 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -214,6 +214,10 @@ function update_706_to_800($type='')
|
|||||||
|
|
||||||
// List of unwanted $pref values which can go
|
// List of unwanted $pref values which can go
|
||||||
$obs_prefs = array('frontpage_type');
|
$obs_prefs = array('frontpage_type');
|
||||||
|
|
||||||
|
// List of DB tables not required (includes a few from 0.6xx)
|
||||||
|
$obs_tables = array('flood', 'headlines', 'stat_info', 'stat_counter', 'stat_last');
|
||||||
|
|
||||||
$do_save = FALSE;
|
$do_save = FALSE;
|
||||||
|
|
||||||
$just_check = $type == 'do' ? FALSE : TRUE; // TRUE if we're just seeing if an update is needed
|
$just_check = $type == 'do' ? FALSE : TRUE; // TRUE if we're just seeing if an update is needed
|
||||||
@@ -325,20 +329,16 @@ function update_706_to_800($type='')
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Obsolete tables
|
// Obsolete tables (list at top)
|
||||||
if (mysql_table_exists("headlines"))
|
foreach ($obs_tables as $ot)
|
||||||
{
|
{
|
||||||
|
if (mysql_table_exists($ot))
|
||||||
|
{
|
||||||
if ($just_check) return update_needed();
|
if ($just_check) return update_needed();
|
||||||
mysql_query('DROP TABLE `'.MPREFIX.'headlines`');
|
mysql_query('DROP TABLE `'.MPREFIX.$ot.'`');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mysql_table_exists("flood"))
|
|
||||||
{
|
|
||||||
if ($just_check) return update_needed();
|
|
||||||
mysql_query('DROP TABLE `'.MPREFIX.'flood`');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($do_save) save_prefs();
|
if ($do_save) save_prefs();
|
||||||
|
|
||||||
@@ -440,20 +440,23 @@ function update_needed()
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function mysql_table_exists($table){
|
function mysql_table_exists($table)
|
||||||
$exists = mysql_query("SELECT 1 FROM ".MPREFIX."$table LIMIT 0");
|
{
|
||||||
if ($exists) return TRUE;
|
$exists = mysql_query("SELECT 1 FROM ".MPREFIX."$table LIMIT 0");
|
||||||
return FALSE;
|
if ($exists) return TRUE;
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function catch_error(){
|
function catch_error()
|
||||||
if (mysql_error()!='' && E107_DEBUG_LEVEL != 0) {
|
{
|
||||||
$tmp2 = debug_backtrace();
|
if (mysql_error()!='' && E107_DEBUG_LEVEL != 0)
|
||||||
$tmp = mysql_error();
|
{
|
||||||
echo $tmp." [ ".basename(__FILE__)." on line ".$tmp2[0]['line']."] <br />";
|
$tmp2 = debug_backtrace();
|
||||||
}
|
$tmp = mysql_error();
|
||||||
return;
|
echo $tmp." [ ".basename(__FILE__)." on line ".$tmp2[0]['line']."] <br />";
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user