Answers for "reverse migration laravel insert"

9

laravel rollback last migration

php artisan migrate:rollback --step=1
Posted by: Guest on May-13-2020
0

laravel migration constrained

Schema::table('posts', function (Blueprint $table) {
    $table->foreignId('user_id')->constrained();
});

/* The foreignId method is an alias for unsignedBigInteger while the
 * constrained method will use conventions to determine the table and
 * column name being referenced. If your table name does not match
 * Laravel's conventions, you may specify the table name by passing it
 * as an argument to the constrained method:
*/

Schema::table('posts', function (Blueprint $table) {
    $table->foreignId('user_id')->constrained('users');
});
Posted by: Guest on December-29-2020

Code answers related to "reverse migration laravel insert"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language