我想为我的应用程序编写测试,但在运行迁移时出现了错误。
我的迁移文件:
![There is no column with name](https://istack.dev59.com/BlRr5.webp)
Schema::table('bill_payments', function (Blueprint $table) {
$table->dropColumn('attachment');
// $table->getColumns(); return empty array
// $table->dropColumn(['attachment']); I tried this
});
dd(Schema::hasColumn('bill_payments', 'attachment')); // Return false
// and this is not working because return false.
if(Schema::hasColumn('bill_payments', 'attachment'))
{
Schema::table('bill_payments', function (Blueprint $table) {
$table->dropColumn('attachment');
});
}
我添加了doctrine/dbal 2.5.13
我正在使用mysql运行测试,但速度很慢。
[已解决]
哇!我为表使用了前缀。我删除了它,现在它可以正常工作。