<?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{Schema::create('scheduled_reports',function(Blueprint $t){$t->id();$t->foreignId('business_id')->index();$t->foreignId('created_by')->nullable()->index();$t->string('name');$t->string('report_type');$t->string('format')->default('pdf');$t->json('filters')->nullable();$t->json('recipients');$t->string('frequency')->default('weekly');$t->dateTime('next_run_at')->index();$t->dateTime('last_sent_at')->nullable();$t->string('status')->default('active');$t->text('last_error')->nullable();$t->timestamps();$t->softDeletes();});}
 public function down():void{Schema::dropIfExists('scheduled_reports');}
};
