mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
drop column torrents.tags
This commit is contained in:
+11
-10
@@ -191,17 +191,18 @@ class Update extends Install
|
|||||||
$this->doLog(__METHOD__ . ", laravel is not available");
|
$this->doLog(__METHOD__ . ", laravel is not available");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (
|
if (NexusDB::schema()->hasColumn('torrents', 'tags')) {
|
||||||
NexusDB::schema()->hasColumn('torrents', 'tags')
|
if (Torrent::query()->where('tags', '>', 0)->count() > 0 && TorrentTag::query()->count() == 0) {
|
||||||
&& Torrent::query()->where('tags', '>', 0)->count() > 0
|
$this->doLog("[MIGRATE_TORRENT_TAG]...");
|
||||||
&& TorrentTag::query()->count() == 0
|
$tagRep = new TagRepository();
|
||||||
) {
|
$tagRep->migrateTorrentTag();
|
||||||
$this->doLog("[MIGRATE_TORRENT_TAG]...");
|
$this->doLog("[MIGRATE_TORRENT_TAG] done!");
|
||||||
$tagRep = new TagRepository();
|
}
|
||||||
$tagRep->migrateTorrentTag();
|
$sql = 'alter table torrents drop column tags';
|
||||||
$this->doLog("[MIGRATE_TORRENT_TAG] done!");
|
sql_query($sql);
|
||||||
|
$this->doLog($sql);
|
||||||
} else {
|
} else {
|
||||||
$this->doLog("no need to run [MIGRATE_TORRENT_TAG]");
|
$this->doLog("torrents table does not has column: tags");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user