2017_06_13_160452_create_jobs_table.php 1010 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateJobsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. if (!Schema::hasTable('jobs')) {
  15. Schema::create('jobs', function (Blueprint $table) {
  16. $table->bigIncrements('id');
  17. $table->string('queue');
  18. $table->longText('payload');
  19. $table->tinyInteger('attempts')->unsigned();
  20. $table->unsignedInteger('reserved_at')->nullable();
  21. $table->unsignedInteger('available_at');
  22. $table->unsignedInteger('created_at');
  23. //$table->index(['queue', 'reserved_at'], 'index');
  24. });
  25. }
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('jobs');
  35. }
  36. }