"라라벨 artisan queue:table"의 두 판 사이의 차이

7번째 줄: 7번째 줄:
root@zetawiki:/var/www/laravel# php artisan queue:table
root@zetawiki:/var/www/laravel# php artisan queue:table
Migration created successfully!
Migration created successfully!
</source>
<source lang='console'>
root@zetawiki:/var/www/laravel# ll database/migrations/ | grep jobs
-rw-r--r-- 1 root  root      905 Feb  4 20:04 2018_02_04_200457_create_jobs_table.php
</source>
<source lang='console'>
root@zetawiki:/var/www/laravel# cat database/migrations/2018_02_04_200457_create_jobs_table.php
</source>
<source lang='php'>
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
    /**
    * Run the migrations.
    *
    * @return void
    */
    public function up()
    {
        Schema::create('jobs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('queue');
            $table->longText('payload');
            $table->unsignedTinyInteger('attempts');
            $table->unsignedInteger('reserved_at')->nullable();
            $table->unsignedInteger('available_at');
            $table->unsignedInteger('created_at');
            $table->index(['queue', 'reserved_at']);
        });
    }
    /**
    * Reverse the migrations.
    *
    * @return void
    */
    public function down()
    {
        Schema::dropIfExists('jobs');
    }
}
</source>
</source>



2018년 2월 4일 (일) 20:11 판

1 개요

artisan queue:table
php artisan queue:table
  • queue jobs 테이블을 위한 마이그레이션을 생성하는 artisan 명령어
root@zetawiki:/var/www/laravel# php artisan queue:table
Migration created successfully!
root@zetawiki:/var/www/laravel# ll database/migrations/ | grep jobs
-rw-r--r-- 1 root   root      905 Feb  4 20:04 2018_02_04_200457_create_jobs_table.php
root@zetawiki:/var/www/laravel# cat database/migrations/2018_02_04_200457_create_jobs_table.php
 
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateJobsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('jobs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('queue');
            $table->longText('payload');
            $table->unsignedTinyInteger('attempts');
            $table->unsignedInteger('reserved_at')->nullable();
            $table->unsignedInteger('available_at');
            $table->unsignedInteger('created_at');

            $table->index(['queue', 'reserved_at']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('jobs');
    }
}

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}