doucong3048 2019-04-01 13:29
浏览 64

“字段列表”中的未知列“valueone”

When attempting to seed data into my database table I keep on receiving the following error: [PDOException] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'valueone' in 'field list'

I have searched all over stackoverflow and google but I'm unable to find a solution. I have tried migrating, refactoring my class names and seeding repeatedly.

My migration file:

    public function change() {
        $table = $this->table('custom_values');
        $table->addColumn('valueone', 'string', [
            'default' => null,
            'limit' => 27,
            'null' => false,
        ]);
        $table->addColumn('valuetwo', 'date', [
            'default' => null,
            'null' => false,
        ]);
        $table->addColumn('valuethree', 'boolean', [
            'default' => null,
            'null' => false,
        ]);
        $table->create();
    }

My seeder:

public function run() {
    $data = [
        [
            'valueone' => 'NL',
            'valuetwo' => date('Y-m-d H:i:s'),
            'valuethree' => true,
        ],
    ];

    $table = $this->table('custom_values');
    $table->insert($data)
        ->save();
}

If only you could help me resolve this issue that would be very much appreciated. Happy coding!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向