:::

4-2 database\migrations\2019_06_21_144827_change_users_table.php

<?php

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

class ChangeUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            // 在 password 欄位後面新增 address 欄位
            $table->string('address')->after('password');
            // 在 address 欄位後面新增 tel 欄位
            $table->string('tel')->after('address');
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('tel');
            $table->dropColumn('address');
        });

    }
}

 


:::

書籍目錄

展開 | 闔起

快速登入


http%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1468%26tbsn%3D44

計數器

今天: 690690690
昨天: 3068306830683068
總計: 8077195807719580771958077195807719580771958077195