:::

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%26tbsn%3D37

計數器

今天: 1539153915391539
昨天: 2665266526652665
總計: 8074976807497680749768074976807497680749768074976