[SCRIPTS] Update clean_file_table

This commit is contained in:
Diogo Peralta Cordeiro 2021-02-21 13:30:09 +00:00
parent f8e6ad416b
commit 890f3bd91e

View File

@ -17,7 +17,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define('INSTALLDIR', dirname(__DIR__));
define('PUBLICDIR', INSTALLDIR . DIRECTORY_SEPARATOR . 'public');
@ -47,8 +46,9 @@ if (!have_option('y', 'yes')) {
print "Deleting";
$file = new File();
$file->whereAdd('filename IS NOT NULL'); // local files
$file->whereAdd('filehash IS NULL', 'AND'); // without filehash value
// Select local files
$file->whereAdd('filename IS NOT NULL');
$file->whereAdd('url IS NULL', 'AND');
if ($file->find()) {
while ($file->fetch()) {
try {