2017-09-11 01:15:44 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
2025-09-24 13:34:19 +02:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
2017-09-11 01:15:44 -05:00
|
|
|
|
2024-03-19 21:03:50 -04:00
|
|
|
return new class extends Migration
|
2017-09-11 01:15:44 -05:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Run the migrations.
|
|
|
|
|
*/
|
2024-03-19 21:12:27 -04:00
|
|
|
public function up(): void
|
2017-09-11 01:15:44 -05:00
|
|
|
{
|
|
|
|
|
Schema::create('tasks', function (Blueprint $table) {
|
|
|
|
|
$table->increments('id');
|
|
|
|
|
$table->unsignedInteger('schedule_id');
|
|
|
|
|
$table->unsignedInteger('sequence_id');
|
|
|
|
|
$table->string('action');
|
|
|
|
|
$table->text('payload');
|
|
|
|
|
$table->unsignedInteger('time_offset');
|
|
|
|
|
$table->boolean('is_queued');
|
|
|
|
|
$table->timestamps();
|
|
|
|
|
|
|
|
|
|
$table->index(['schedule_id', 'sequence_id']);
|
|
|
|
|
$table->foreign('schedule_id')->references('id')->on('schedules')->onDelete('cascade');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Reverse the migrations.
|
|
|
|
|
*/
|
2024-03-19 21:12:27 -04:00
|
|
|
public function down(): void
|
2017-09-11 01:15:44 -05:00
|
|
|
{
|
|
|
|
|
Schema::dropIfExists('tasks');
|
|
|
|
|
}
|
2024-03-19 21:03:50 -04:00
|
|
|
};
|