Ad
Laravel: How To Rollback Column Unique
My table name is customers
column is mail
I tried with syntax
public function down()
{
Schema::table('customers', function (Blueprint $table) {
$table->dropUnique('mail');
$table->string('mail',255)->change();
$table->string('first_name',255)->change();
$table->string('first_name_reading',255)->change();
$table->string('last_name',255)->change();
$table->string('platform',255)->change();
});
}
But it not work.
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'mail'; check that column/key exists (SQL: alter
table `customers` drop index `mail`)
Can you give me your help! Please,
Ad
Answer
Open mysql console and get correct index key name for customers table and use that with your code $table->dropUnique('correct_name');
SHOW INDEX FROM customers;
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms
Ad