:::

17-2 異動資料表

  1. 建立異動資料表用的migration
    php artisan make:migration add_tests_cols --table=tests
  2.  編輯\專案\database\migrations\2018_08_10_001435_add_tests_cols.php
    public function up()
    {
        Schema::table('tests', function (Blueprint $table) {
            $table->unsignedTinyInteger('grade');
            $table->unsignedTinyInteger('class');
            $table->unsignedTinyInteger('num');
        });
    }

    以及

    public function down()
    {
        Schema::table('tests', function (Blueprint $table) {
            $table->dropColumn(['grade', 'class', 'num']);
        });
    }

:::

書籍目錄

展開 | 闔起

http%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1328

計數器

今天: 3822382238223822
昨天: 3438343834383438
總計: 7394151739415173941517394151739415173941517394151