feat(schedule): add schedule:bootstrap and minute-precise automation runs

Install per-module schedule:run cron from artisan, store sms/in_app send minutes, and match scheduled triggers at exact HH:mm Tehran time.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-24 22:13:06 +03:30
co-authored by Cursor
parent 9bb0fa3a1d
commit 1c8ab4b725
7 changed files with 214 additions and 17 deletions
@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
if (! Schema::hasTable('automations')) {
return;
}
Schema::table('automations', function (Blueprint $table) {
if (! Schema::hasColumn('automations', 'sms_send_minute')) {
$table->unsignedTinyInteger('sms_send_minute')->nullable()->after('sms_send_hour');
}
if (! Schema::hasColumn('automations', 'in_app_send_minute')) {
$table->unsignedTinyInteger('in_app_send_minute')->nullable()->after('in_app_send_hour');
}
});
}
public function down(): void
{
if (! Schema::hasTable('automations')) {
return;
}
Schema::table('automations', function (Blueprint $table) {
if (Schema::hasColumn('automations', 'sms_send_minute')) {
$table->dropColumn('sms_send_minute');
}
if (Schema::hasColumn('automations', 'in_app_send_minute')) {
$table->dropColumn('in_app_send_minute');
}
});
}
};