:::

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']);
        });
    }

:::

書籍目錄

展開 | 闔起

https%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1328%26tbsn%3D37

計數器

今天: 617617617
昨天: 2027202720272027
總計: 7971658797165879716587971658797165879716587971658