Migracje wymagane pola Laravela
$table->string('foo')->nullable(false)->change();
r00ster
$table->string('foo')->nullable(false)->change();
Schema::rename($currentTableName, $newTableName);
php artisan make:migration rename_author_id_in_posts_table --table=posts
public function up()
{
Schema::table('posts', function (Blueprint $table) {
$table->renameColumn('author_ID', 'user_id');
});
}
php artisan make:migration alter_your_table --table=your_table
public function down()
{
Schema::table('posts', function (Blueprint $table) {
$table->renameColumn('user_id', 'author_ID');
});
}