我已按照教程(此处)设置我的应用程序。然后我尝试复制创建更多表的步骤,所以我在终端中运行了一些命令,例如:
php artisan migrate:make create_generalUserInfo_table
然后在我添加的 create_generalUserInfo_table 文件中:
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateGeneralUserInfoTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('generalUserInfo', function($table){
$table->increments('id');
$table->integer('user_id');
$table->string('firstname', 100);
$table->string('lastname', 100);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('generalUserInfo');
}
}
然后回到终端我跑了:
php artisan migrate:refresh
它正在添加移民,但未在 mysql 中创建表。创建了初始教程中的用户表
Migrated: 2015_01_28_055418_create_users_table
Migrated: 2015_01_28_213951_create_imprints_table
Migrated: 2015_01_28_214023_create_generalUserInfo_table
Migrated: 2015_01_28_214103_create_roles_table
Migrated: 2015_01_28_214114_create_role_user_table
Migrated: 2015_01_28_214146_create_comments_table
Migrated: 2015_01_28_214159_create_books_table