我正在运行全新安装的 Laravel,其中包含干净的数据库和文件。
我创建了一个名为“frooth”的表,其中包含 id、title 和 created_at 列(id PK、varchar 和 datetime)
当我运行“php artisan make:migration frooth”命令时,创建的迁移文件是空的,只包含 up() 和 down() 函数,仅此而已(没有列)
我该如何解决这个问题,我遵循官方网站中记录的框架的基本配置,我可以按预期访问和创建工匠中的功能,只有迁移它不起作用。
我使用以下命令生成了项目:composer create-project --prefer-dist laravel/laravel blog
create table laravel.frooth
(
id int auto_increment
primary key,
title varchar(250) null,
created_at datetime null
);
在 database/migrations/2019_10_25_012925_frooth.php 中生成的 PHP 类:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class Frooth extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
控制台输出:
php artisan make:migration frooth
Created Migration: 2019_10_25_012925_frooth