라라벨 artisan make:migration --table

Jmnote (토론 | 기여)님의 2016년 5월 15일 (일) 21:33 판 (새 문서: ==개요== ;<nowiki>라라벨 artisan make:migration --table</nowiki> * artisan make:migration에 <code>--table</code> 옵션을 붙인 것 <source lang='console'> root@zetawiki:...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

라라벨 artisan make:migration --table
root@zetawiki:/var/www/laravel# php artisan make:migration create_photos_table --table=photos
root@zetawiki:/var/www/laravel# php artisan migrate:status
+------+------------------------------------------------+
| Ran? | Migration                                      |
+------+------------------------------------------------+
| Y    | 2014_10_12_100000_create_password_resets_table |
| Y    | 2015_10_27_141258_create_tasks_table           |
| N    | 2016_05_15_122936_create_photos_table          |
+------+------------------------------------------------+
root@zetawiki:/var/www/laravel# cat database/migrations/2016_05_15_122936_create_photos_table.php
<?php

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

class CreatePhotosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('photos', function (Blueprint $table) {
            //
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('photos', function (Blueprint $table) {
            //
        });
    }
}

2 같이 보기

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