[英]Laravel How can I remove unique column
這是我的
public function down()
{
Schema::table('customer_plans', function (Blueprint $table) {
$table->dropUnique('customer_plans_code_unique');
$table->string('code',255)->change();
$table->string('name',255)->change();
});
}
我這樣做是laravel.com,但出現此錯誤
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'customer_plans_code_unique'; check that column/
key exists
任何人都知道此錯誤,請告訴我! 謝謝閱讀!
嘗試刪除$table->dropUnique('customer_plans_code_unique');
從您的代碼。
沒有看到其余的代碼,我無法判斷該行是否重要,但這絕對是您看到此錯誤的原因。
給我看你的up()函數,我可以給你更多的反饋。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.