torrents table last_action add index

This commit is contained in:
xiaomlove
2025-01-20 01:49:06 +08:00
parent d06d677565
commit a74a2c3c2a
4 changed files with 33 additions and 8 deletions

View File

@@ -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)");
}
}
}