From bd0a63c8d4a0980193a7d7222fa8aa912097816c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 26 May 2023 09:14:57 +0200 Subject: [PATCH] wait #5946 @0.5 --- app/Console/Commands/WorkshopMigration.php | 4 ++++ app/Console/Kernel.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/Console/Commands/WorkshopMigration.php b/app/Console/Commands/WorkshopMigration.php index 6660b4a70..dab5fd264 100644 --- a/app/Console/Commands/WorkshopMigration.php +++ b/app/Console/Commands/WorkshopMigration.php @@ -205,6 +205,10 @@ class WorkshopMigration extends CubistCommand DB::update('DELETE FROM fluidbook_publication WHERE id<' . self::WS3_BOOK_ID); } else if ($this->option('publications') === 'all') { FluidbookPublication::truncate(); + } else if ($this->option('publications') === 'missing') { + // Get highest fluidbook on toolbox with a number less thant WS3_BOOK_ID + $f = FluidbookPublication::withoutGlobalScopes()->where('id', '<', self::WS3_BOOK_ID)->orderBy('id', 'DESC')->first(); + $q->where('book_id', '>', $f->id); } else { $range = ArrayUtil::parseRange($this->option('publications')); FluidbookPublication::withoutGlobalScopes()->whereIn('id', $range)->delete(); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index fd35aa858..dca2c25e7 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -33,7 +33,9 @@ class Kernel extends \Cubist\Backpack\Console\Kernel $schedule->command('job:dispatchNow Maintenance\\\\CheckPublicationsHashAndCid')->dailyAt('3:00'); $schedule->command('job:dispatchNow Maintenance\\\\CleanDownloads')->dailyAt('4:00'); $schedule->command('job:dispatchNow Maintenance\\\\CleanFTP')->dailyAt('4:30'); + // WS to Toolbox migration $schedule->command('ws:migrate --publications=v2 --documents=missing')->dailyAt('1:00'); + $schedule->command('ws:migrate --publications=missing --documents=missing')->hourly(); $schedule->command('fluidbook:quote --reminder')->weekdays()->at('10:00'); } -- 2.39.5