]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5946 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 26 May 2023 07:14:57 +0000 (09:14 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 26 May 2023 07:14:57 +0000 (09:14 +0200)
app/Console/Commands/WorkshopMigration.php
app/Console/Kernel.php

index 6660b4a70905f779ff2277a6c3dc457b0cf1d649..dab5fd26491590a90f084ebdb7a55c07e584db75 100644 (file)
@@ -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();
index fd35aa8583df0fd88166e8c8d8b9390ac867bcf1..dca2c25e7ebb22a024a269e8482b88b9664cf1fb 100644 (file)
@@ -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');
         }