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

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 2개는 보이지 않습니다)
4번째 줄: 4번째 줄:
* queue jobs 테이블을 위한 마이그레이션을 생성하는 artisan 명령어  
* queue jobs 테이블을 위한 마이그레이션을 생성하는 artisan 명령어  


<source lang='console'>
<syntaxhighlight lang='console'>
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>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:/var/www/laravel# php artisan migrate:status
root@zetawiki:/var/www/laravel# php artisan migrate:status
+------+------------------------------------------------+
+------+------------------------------------------------+
17번째 줄: 17번째 줄:
| N    | 2018_02_04_200457_create_jobs_table            |
| N    | 2018_02_04_200457_create_jobs_table            |
+------+------------------------------------------------+
+------+------------------------------------------------+
</source>
</syntaxhighlight>


==(Optional) 확인==
==(Optional) 확인==
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:/var/www/laravel# ll database/migrations/ | grep jobs
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
-rw-r--r-- 1 root  root      905 Feb  4 20:04 2018_02_04_200457_create_jobs_table.php
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:/var/www/laravel# cat database/migrations/2018_02_04_200457_create_jobs_table.php
root@zetawiki:/var/www/laravel# cat database/migrations/2018_02_04_200457_create_jobs_table.php
</source>
</syntaxhighlight>
<source lang='php'>
<syntaxhighlight lang='php'>
<?php
<?php


66번째 줄: 66번째 줄:
     }
     }
}
}
</source>
</syntaxhighlight>


==artisan migrate==
==artisan migrate==
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:/var/www/laravel# php artisan migrate
root@zetawiki:/var/www/laravel# php artisan migrate
Migrating: 2018_02_04_200457_create_jobs_table
Migrating: 2018_02_04_200457_create_jobs_table
Migrated:  2018_02_04_200457_create_jobs_table
Migrated:  2018_02_04_200457_create_jobs_table
</source>
</syntaxhighlight>
:'Specified key was too long error' 오류 발생하면 https://laravel-news.com/laravel-5-4-key-too-long-error 참고
:'Specified key was too long error' 오류 발생하면 https://laravel-news.com/laravel-5-4-key-too-long-error 참고


==같이 보기==
==같이 보기==
* [[php artisan migrate]]
* [[라라벨 artisan migrate]]
* [[php artisan migrate:status]]
* [[라라벨 artisan migrate:status]]
* [[라라벨 artisan queue:failed-table]]
* [[라라벨 artisan 명령어]]
* [[라라벨 artisan 명령어]]
* [[라라벨 CreateJobsTable 클래스]]
* [[라라벨 CreateJobsTable 클래스]]
* [[라라벨 jobs 테이블]]


==참고==
==참고==

2020년 11월 2일 (월) 02:58 기준 최신판

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# php artisan migrate:status
+------+------------------------------------------------+
| Ran? | Migration                                      |
+------+------------------------------------------------+
| Y    | 2014_10_12_000000_create_users_table           |
| Y    | 2014_10_12_100000_create_password_resets_table |
| N    | 2018_02_04_200457_create_jobs_table            |
+------+------------------------------------------------+

2 (Optional) 확인[ | ]

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');
    }
}

3 artisan migrate[ | ]

root@zetawiki:/var/www/laravel# php artisan migrate
Migrating: 2018_02_04_200457_create_jobs_table
Migrated:  2018_02_04_200457_create_jobs_table
'Specified key was too long error' 오류 발생하면 https://laravel-news.com/laravel-5-4-key-too-long-error 참고

4 같이 보기[ | ]

5 참고[ | ]

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