【发布时间】:2013-09-26 13:49:54
【问题描述】:
我正在尝试学习 Laravel。我正在关注快速入门文档,但遇到了迁移问题。我在这一步:http://laravel.com/docs/quick#creating-a-migration
当我运行命令php artisan migrate时,命令行显示如下:
c:\wamp\www\laravel>php artisan migrate
Migration table created successfully.
Migrated: 2013_09_21_040037_create_users_table
在数据库中,我看到一个 migrations 表创建了 1 条记录。但是,我没有看到users 表。所以,我无法继续学习本教程的 ORM 部分。
任何想法我可能做错了什么?为什么没有创建 users 表?
EDIT 1(原始迁移文件):
<?php
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function($table)
{
$table->increments('id');
$table->string('email')->unique();
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}
【问题讨论】: