mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Remove the new tpg script from _run_once, add the procedure to patch 0166.
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program (see LICENSE.txt in the base directory. If
|
||||
* not, see:
|
||||
*
|
||||
* @link <http://www.gnu.org/licenses/>.
|
||||
* @author niel
|
||||
* @copyright 2014 nZEDb
|
||||
*/
|
||||
require_once dirname(__FILE__) . '/../../../www/config.php';
|
||||
use newznab\db\Settings;
|
||||
$pdo = new Settings();
|
||||
if (!$pdo->getSetting('tablepergroup')) {
|
||||
exit("Tables per groups is not enabled, quitting!");
|
||||
}
|
||||
// Doing it this way in case there are tables existing not related to the active/backfill list (i.e. I don't have a clue when these tables get deleted so I'm doing any that are there).
|
||||
$tables1 = $pdo->queryDirect("SELECT SUBSTR(TABLE_NAME, 12) AS suffix FROM information_schema.TABLES WHERE TABLE_SCHEMA = (SELECT DATABASE()) AND TABLE_NAME LIKE 'collections%' ORDER BY TABLE_NAME");
|
||||
$tables2 = $pdo->queryDirect("SELECT SUBSTR(TABLE_NAME, 9) AS suffix FROM information_schema.TABLES WHERE TABLE_SCHEMA = (SELECT DATABASE()) AND TABLE_NAME LIKE 'binaries%' ORDER BY TABLE_NAME");
|
||||
$query1 = "ALTER TABLE collections%s ADD COLUMN date_initial TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER fromname";
|
||||
$query2 = "ALTER TABLE collections%s ADD INDEX ix_collections_date_initial (date_initial)";
|
||||
$query3 = "ALTER TABLE binaries%s MODIFY COLUMN partcheck TINYINT(1) NOT NULL DEFAULT '0'";
|
||||
if ($tables1 instanceof \Traversable && $tables2 instanceof \Traversable) {
|
||||
foreach ($tables1 as $table1) {
|
||||
echo "Updating table collections{$table1['suffix']}" . PHP_EOL;
|
||||
$pdo->queryExec(sprintf($query1, $table1['suffix']), true);
|
||||
$pdo->queryExec(sprintf($query2, $table1['suffix']), true);
|
||||
}
|
||||
foreach ($tables2 as $table2) {
|
||||
echo "Updating table binaries{$table2['suffix']}" . PHP_EOL;
|
||||
$pdo->queryExec(sprintf($query3, $table2['suffix']), true);
|
||||
}
|
||||
echo 'All done!' . PHP_EOL;
|
||||
}
|
||||
Reference in New Issue
Block a user