라라벨 Database Migration
라라벨 DB 마이그레이션
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
php artisan migrate:refresh