라라벨 마이그레이션 생성 artisan make:migration

(라라벨 migration 생성에서 넘어옴)

1 개요[ | ]

라라벨 migration 생성
라라벨 artisan make:migration
  • migration을 생성하는 artisan 명령어
  • create, drop, 컬럼 코드를 생성해주는 --create 옵션을 사용하는 것도 좋다.

2 예시[ | ]

root@zetawiki:/var/www/laravel# php artisan make:migration create_photos_table
Created Migration: 2016_05_15_090840_create_photos_table
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_090840_create_photos_table          |
+------+------------------------------------------------+
root@zetawiki:/var/www/laravel# cat database/migrations/2016_05_15_090840_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()
    {
        //
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}

3 같이 보기[ | ]

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