Create jobs table to replace internal cron queue driver

This commit is contained in:
Samuel Georges 2015-02-07 21:07:08 +11:00
parent 5055adfab2
commit a2a929a17a
3 changed files with 31 additions and 26 deletions

View File

@ -45,6 +45,10 @@ Optional things you can delete, if they do not contain anything custom.
[DELETE] /storage/combiner
[DELETE] /storage/twig
Tables that can be deleted:
Schema::dropIfExists('cron_queue');
### Removed config
cms.tempDir - use temp_path()

View File

@ -1,26 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class DbCronQueue extends Migration
{
public function up()
{
Schema::create('cron_queue', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->integer('delay')->default(0);
$table->integer('status')->default(0);
$table->integer('retries')->default(0);
$table->text('payload')->nullable();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('cron_queue');
}
}

View File

@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class DbJobs extends Migration
{
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id');
$table->string('queue');
$table->text('payload');
$table->tinyInteger('attempts')->unsigned();
$table->tinyInteger('reserved')->unsigned();
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
}
public function down()
{
Schema::dropIfExists('jobs');
}
}