added a couple scripts for sql

This commit is contained in:
jonnyboy
2013-04-01 02:09:21 -04:00
parent 7faca60a1b
commit 6334b88fc9
8 changed files with 68 additions and 21 deletions
+19
View File
@@ -0,0 +1,19 @@
<?php
require(dirname(__FILE__)."/../bin/config.php");
require(WWW_DIR."/lib/framework/cache.php");
require_once(WWW_DIR."/lib/framework/db.php");
$sql = "SHOW tables";
$db = new DB();
$tables = $db->query($sql);
foreach($tables as $row)
{
$tbl = $row['Tables_in_newznab'];
printf("Converting $tbl\n");
$sql = "ALTER TABLE $tbl ENGINE=INNODB ROW_FORMAT=DYNAMIC";
$db->query($sql);
}
?>
+11
View File
@@ -0,0 +1,11 @@
<?php
require(dirname(__FILE__)."/../bin/config.php");
require_once(WWW_DIR."/lib/framework/db.php");
$db = new DB;
$rel = $db->query("truncate table parts");
$rel = $db->query("truncate table partsrepair");
$rel = $db->query("truncate table binaries;");
?>