Skip to content

Commit 7ac2bb7

Browse files
committed
feat: add migration stub
1 parent abf68cd commit 7ac2bb7

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
use Leaf\Database;
4+
use Illuminate\Database\Schema\Blueprint;
5+
6+
class CreateJobs extends Database
7+
{
8+
/**
9+
* Run the migrations.
10+
* @return void
11+
*/
12+
public function up()
13+
{
14+
if (!static::$capsule::schema()->hasTable(_env('QUEUE_TABLE', 'leafphp_queue_jobs'))) :
15+
static::$capsule::schema()->create(_env('QUEUE_TABLE', 'leafphp_queue_jobs'), function (Blueprint $table) {
16+
$table->increments('id');
17+
$table->string('class');
18+
$table->text('config');
19+
$table->string('status')->default('pending');
20+
$table->integer('retry_count')->default(0);
21+
$table->timestamps();
22+
});
23+
endif;
24+
}
25+
26+
/**
27+
* Reverse the migrations.
28+
* @return void
29+
*/
30+
public function down()
31+
{
32+
static::$capsule::schema()->dropIfExists(_env('QUEUE_TABLE', 'leafphp_queue_jobs'));
33+
}
34+
}

0 commit comments

Comments
 (0)