1 개요

라라벨 Database Migration

라라벨 DB 마이그레이션

2 마이그레이션 생성

php artisan make:migration create_tasks_table --create=tasks
<?php

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

class CreateTasksTable extends Migration
{
    public function up()
    {
        Schema::create('tasks', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::drop('tasks');
    }
}
php artisan migrate:status
php artisan migrate

3 DB 마이그레이션 변경

php artisan migrate:refresh