lundi 9 avril 2018

Cannot rename date time column with Laravel Migrtions

I want to simply rename my one column although it keeps saying

SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'sendReminderCouple48' (SQL: ALTER TABLE sendIntakes CHANGE sendReminderCouple36 sendReminderCouple48 DATETIME DE  
  FAULT 'NULL') 

Currently its sendReminderCouple36 - DATETIME - NULLABLE

All I want to do is rename it to sendReminderCouple48

public function up()
{
    Schema::table('sendIntakes', function (Blueprint $table) {
        $table->renameColumn('sendReminderCouple36', 'sendReminderCouple48');
    });
}

public function down()
{
    Schema::table('sendIntakes', function (Blueprint $table) {
        $table->renameColumn('sendReminderCouple48', 'sendReminderCouple36');
    });
}

Note: I do not want to do any strict changes in my config file.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire