我已经像这样迁移了
public function up()
{
Schema::create('permissions', function ($table) {
$table->increments('id');
$table->tinyInteger('value');
$table->string('name', 50);
$table->timestamps();
$table->integer('techniciansgroup_id')->nullable()->unsigned();
$table->foreign('techniciansgroup_id')->references('id')->on('techniciansgroups')->onDelete('cascade');
});
}
public function down()
{
Schema::drop('permissions');
}
当我使用这个命令
php artisan migrate
数据库创建正确
但是当我使用回滚命令时
php artisan migrate:rollback
显示此错误
[Symfony''Component''Debug''Exception''FatalErrorException]
找不到类"权限"
我删除迁移和删除数据库的权限
之后,我进行权限迁移并使用php artisan migrate
,最后使用
php artisan migrate:rollback
正确工作。