I am trying to run a migration renaming a column on one of my tables. Whenever I try to rename the column, it gives me the error below.
"There is no column with name 'column_name_id' on table 'Table-Name.'"
However, the reason there is no column 'column_name_id' is that it is supposed to be 'Column_Name_ID' case sensitive like I wrote it.
I have tried to use strtoupper()
. I have also used backticks to see if that helped. No joy.
I'm not sure whether or not this is an issue with my DB settings, but I've used renameColumn before with no problems.
public function up()
{
Schema::table('`Table-Name`', function (Blueprint $table) {
$table->renameColumn('Column_Name_ID', 'Column_Name');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('`Table-Name`', function (Blueprint $table) {
$table->renameColumn('Column_Name', 'Column_Name_ID');
});
}