Laravel 基礎(三)

DB 建立與刪除


//php72 artisan migrate

//php72 artisan migrate:refresh

//web/laravel/database/migrations


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

class Test extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('test1',function(Blueprint $table){
        	
        	$table->increments('id');
        	$table->string('username')->nulllable()->default('abc');
        	$table->char('password', 100);
        	
        	});
    }

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

4
Tags: No tags

Comments are closed.