gpt4 book ai didi

octobercms - 无法创建表。

转载 作者:行者123 更新时间:2023-12-05 01:19:34 27 4
gpt4 key购买 nike

我是 10 月的新手,遇到了一个我无法解决的问题。当我从命令行创建一个插件,然后运行 ​​插件:刷新 数据库中的表没有被创建。

version.yaml 根据文档是正确的。以下是文件的内容。
插件/Mejlak/PropertyExtender/Updates/create_extras_table.php

<?php namespace Mejlak\Propertyextender\Updates;

use Schema;
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;

class CreateExtrasTable extends Migration
{
public function up()
{
Schema::create('mejlak_propertyextender_extras', function(Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('title');
$table->timestamps();
});
}

public function down()
{
Schema::dropIfExists('mejlak_propertyextender_extras');
}
}

这是 version.yaml
1.0.1: 
- 'First version of propertyextender'
- create_extras_table.php

任何帮助将不胜感激

最佳答案

我猜根据@OsDev 的建议,目录名称可能存在问题。

你给我们的更新路径是

Plugin/Mejlak/PropertyExtender/Updates/create_extras_table.php



所以在这种情况下你可以更正一些文件夹名称

我不确定,但您所有的文件夹名称都以大写字母开头,在 10 月的 cms 中全部都以小写字母书写,因此您的路径应该是

plugin/mejlak/propertyextender/updates/create_extras_table.php



是的,在命名空间中它是正确的,所以不需要在那里改变

namespace Mejlak\Propertyextender\Updates



然后尝试一下,如果仍然无法正常工作,请发表评论。

关于octobercms - 无法创建表。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47545334/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com