我是Laravel的新学习者,我跟着教程创建了一张文章表。这是我在/database/migrations/2017_02_13_145946_create_article_table.php文件中的部分代码:
public function up()
{
//
Schema::create('articles', function(Blueprint $table)
{
$table->increments('id');
$table->string('title');
$table->text('body')->nullable();
$table->integer('user_id');
$table->timestamps();
});
}
当我运行php artisan migrate
时,表格没有被创建。我在Google上搜索了这个问题,并运行了php artisan migrate:reset
命令来删除所有的表格。当我再次运行php artisan migrate
命令时,它显示:
Migrated: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrated: 2017_02_13_145946_create_article_table
但仅更新迁移表的记录,并未创建任何内容。表user
和password_resets
也没有被创建。
你有什么想法,我可能做错了什么?