<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddIsAdminColumnToPostsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('posts', function (Blueprint $table) {
//
$table->tinyInteger('is_admin')->default('0'); // added
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('posts', function (Blueprint $table) {
//
$table->dropColumn('is_admin'); // added
});
}
}
add_is_admin_column_to_posts_table
is file description--table="posts"
is referencing table name
php artisan make:migration add_is_admin_column_to_posts_table --table="posts"
php artisan migrate