mostafalaravel
5 days ago

Migrate: Cannot declare class , because the name is already in use

Posted 5 days ago by mostafalaravel

Hello ,

I have this error message in production server :

 Cannot declare class RenameTeamleadercompanyidInTeamleaderDeals, because the name is already in use

I have two migrations with the same calss name RenameTeamleadercompanyidInTeamleaderDeals

class RenameTeamleadercompanyidInTeamleaderDeals extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('teamleader_deals', function (Blueprint $table) {
            $table->renameColumn('teamleader_lead_company_id','teamleader_company_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('teamleader_deals', function (Blueprint $table) {
            //
        });
    }
}

the second one :

class RenameTeamleadercompanyidInTeamleaderDeals extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('teamleader_deals', function (Blueprint $table) {
            $table->renameColumn('teamleader_company_id', 'teamleader_lead_company_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('teamleader_deals', function (Blueprint $table) {
            //
        });
    }
}

Is it possible to just change the lass name of one of them ? then Re-migrate ?

thanks

Please sign in or create an account to participate in this conversation.