File: /home/imensosw/www/amanda/database/migrations/2020_12_01_061539_create_product_price_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProductPriceTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('product_price', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('product_id');
$table->double('price',10,2)->default('0');
$table->string('days')->default('0');
$table->enum('status',['active','deactive']);
$table->foreign('product_id')->references('id')->on('products');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('product_price');
}
}