代碼: 選擇全部
php artisan migrate:make create_users_table --table=users --create
內容為
代碼: 選擇全部
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('countries', function(Blueprint $table)
{
//
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('countries', function(Blueprint $table)
{
//
});
}
}
up
代碼: 選擇全部
Schema::create('countries', function(Blueprint $table)
{
$table->increments('id');
$table->string('iso');
$table->timestamps();
});
代碼: 選擇全部
Schema::drop('countries');
代碼: 選擇全部
php artisan migrate