evol table products for null product types

This commit is contained in:
Olivier Legat 2021-05-03 17:51:39 +02:00
parent d80d20c77a
commit 4805ecb0fa

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('products', function (Blueprint $table) {
$table->string('product_type')->default(null)->change();
$table->string('product_type')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('products', function (Blueprint $table) {
$table->string('product_type')->default('foodProduct')->change();
$table->string('product_type')->nullable(false)->change();
});
}
}