for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductCostsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create('product_costs', function (Blueprint $table) {
$table->increments('id');
$table->integer('product_id')->unsigned();
$table->decimal('price', 10, 2);
$table->timestamps();
$table->foreign('product_id')->references('id')->on('products');
});
}
* Reverse the migrations.
public function down()
Schema::table('product_costs', function (Blueprint $table) {
$table->dropForeign(['product_id']);
Schema::dropIfExists('product_costs');