mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-05 07:20:58 +08:00
torrents table last_action add index
This commit is contained in:
@@ -28,6 +28,9 @@ class MigrateTorrentsTableTextColumn extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if (Schema::hasTable("torrent_extras") && Schema::hasColumn("torrents", "descr")) {
|
||||
NexusDB::statement("insert into torrent_extras (torrent_id, descr, media_info, nfo, created_at) select id, descr, technical_info, nfo, now() from torrents on duplicate key update torrent_id = values(torrent_id)");
|
||||
}
|
||||
$columns = ["ori_descr", "descr", "nfo", "technical_info", "pt_gen"];
|
||||
$sql = "alter table torrents ";
|
||||
$drops = [];
|
||||
@@ -40,8 +43,5 @@ class MigrateTorrentsTableTextColumn extends Command
|
||||
$sql .= implode(",", $drops);
|
||||
NexusDB::statement($sql);
|
||||
}
|
||||
if (Schema::hasTable("torrent_extras")) {
|
||||
NexusDB::statement("insert torrent_extras (torrent_id, descr, media_info, nfo, created_at) select id, descr, technical_info, nfo, now() from torrents on duplicate key update torrent_id = values(torrent_id)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user