Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

NumanArshad's avatar

heroku run migration error

Hello Sir, I want to deploy my laravel site on heroku but as I run command "heroku run php artisan migrate" following error appear -> "sqlstate[42703] undefined column 7 error" in Connection.php

0 likes
7 replies
NumanArshad's avatar

No sir! Although I did n't set env config in heroku but some table migrate successfully and then error appear for specific table.

NumanArshad's avatar

Here is schema Schema::table('consult_bookings', function (Blueprint $table) {

        $table->renameColumn('doctoravailabilityId','doctorId');
        $table->string('skypeId')->nullable();
       
    });

and I am getting error below :

in Connection.php line 644: SQLSTATE[42703] undefined column: 7 column:doctoravailabilityid does not exist (SQL:ALTER TABLE "consult_bookings" RENAME COLUMN doctoravailabilityId to doctorId) in PDOStatement.php line 123: SQLSTATE[42703] undefined column: 7 column:doctoravailabilityid does not exist in PDOStatement.php line 121: SQLSTATE[42703] undefined column: 7 column:doctoravailabilityid does not exist

Sinnbeck's avatar

Well that should be easy to check. Open the database on heroku and check the table consult_bookings for a column named doctoravailabilityid

NumanArshad's avatar

But in heroku schema column I found is doctoravailabilityId but not doctoravailabilityid

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

I believe that mysql can be changed from case insensitive (default) to being case sensitive. My guess would be that you local machine isnt (it works) and Heruko is (does not work).

Change your migration to fit exactly with the naming. Perhaps consider in the future using _ to separate words

doctor_availability_id

Edit: Is heroku using postgresql? I think that is case sensitive by default

Please or to participate in this conversation.