diff --git a/database/migrations/2025_05_28_130414_create_motor_testing_masters_table.php b/database/migrations/2025_05_27_130414_create_motor_testing_masters_table.php similarity index 100% rename from database/migrations/2025_05_28_130414_create_motor_testing_masters_table.php rename to database/migrations/2025_05_27_130414_create_motor_testing_masters_table.php diff --git a/database/migrations/2025_07_02_150723_create_alert_mail_rules_table.php b/database/migrations/2025_07_02_150723_create_alert_mail_rules_table.php index 8aeae48a0..6559ddf16 100644 --- a/database/migrations/2025_07_02_150723_create_alert_mail_rules_table.php +++ b/database/migrations/2025_07_02_150723_create_alert_mail_rules_table.php @@ -14,6 +14,7 @@ return new class extends Migration $sql = <<<'SQL' CREATE TABLE alert_mail_rules ( id BIGINT GENERATED always AS IDENTITY PRIMARY KEY, + plant BIGINT NOT NULL DEFAULT(0), module TEXT NOT NULL, rule_name TEXT NOT NULL, diff --git a/database/migrations/2025_07_10_121812_add_plant_to_alert_mail_rules.php b/database/migrations/2025_07_10_121812_add_plant_to_alert_mail_rules.php deleted file mode 100644 index 01a4ccfa9..000000000 --- a/database/migrations/2025_07_10_121812_add_plant_to_alert_mail_rules.php +++ /dev/null @@ -1,33 +0,0 @@ -comment(Inspiring::quote()); })->purpose('Display an inspiring quote'); - // Schedule::command('send:invoice-report'); - // Schedule::command('send:production-report'); +// Schedule::command('send:invoice-report'); + // Schedule::command('send:production-report'); - app()->booted(function () { - $schedule = app(Schedule::class); + app()->booted(function () { + $schedule = app(Schedule::class); - //Production report scheduling +// Production report scheduling - $productionRules = AlertMailRule::where('module', 'ProductionQuantities') + $productionRules = AlertMailRule::where('module', 'ProductionQuantities') ->where('rule_name', 'ProductionMail') - //->select('plant', 'schedule_type') + ->select('plant', 'schedule_type') ->select('plant', 'schedule_type') ->distinct() ->get(); @@ -31,7 +31,7 @@ Artisan::command('inspire', function () { $command = $schedule->command('send:production-report', [$type, $plantId]); switch ($type) { - case 'Live': + case 'Live': $command->everyMinute(); break; case 'Hourly': @@ -65,8 +65,8 @@ Artisan::command('inspire', function () { case 'Daily': $command->dailyAt('07:59'); break; - } + } } - }); + });