for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProductSkusTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create('product_skus', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('product_id');
$table->string('code')->unique();
$table->decimal('price', 8, 2)->default(0);
$table->decimal('cost', 8, 2)->default(0);
$table->foreign('product_id')
->references('id')
->on('products')
->onDelete('cascade');
});
}
* Reverse the migrations.
public function down()
Schema::dropIfExists('product_skus');