【发布时间】:2014-07-01 22:47:24
【问题描述】:
我今天早上一直在做 Laravel 的快速入门,但我在迁移部分遇到了一些问题。我在 Windows 8.1 上运行它,使用 XAMPP 的最后一个版本、Laravel 的最后一个版本和 windows 的 CMD 命令。
我已经创建了迁移文件“users”,您可以在下一段代码中看到:
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function(Blueprint $table) {
$table->integer('id', true);
$table->string('name');
$table->string('username')->unique();
$table->string('email')->unique();
$table->string('password');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}
迁移表已创建,我正在使用下一个创建用户表:
php artisan migrate
这就是答案:
Aplication in production!
Do you really wish to run this command? yes
Nothing to migrate.
(我无法显示图片,因为这是我的第一个问题)
希望你能帮助我,我想继续尝试这个框架,但我不知道如何解决这个问题,已经谷歌搜索了一个小时,但没有任何效果。
【问题讨论】:
-
你是说迁移文件的名字是
users? -
迁移文件的名字是migrations
-
我猜这不是问题。