Answers for "add nullable to field in migration laravel 7 file without deleting data"

PHP
3

laravel migration make column nullable

Schema::table('users', function($table)
{
    $table->string('name', 50)->nullable()->change();
});

This is the correct syntax to revert the migration:

$table->integer('user_id')->unsigned()->nullable(false)->change();
Posted by: Guest on January-21-2021
3

laravel migration on delete set null

$table->...->onDelete('set null');
Posted by: Guest on April-22-2020

Code answers related to "add nullable to field in migration laravel 7 file without deleting data"

Browse Popular Code Answers by Language