ldc-cocotte/database/migrations/2020_11_09_113830_create_stats.php
2020-11-17 13:41:31 +01:00

35 lines
785 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateStats extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('stats', function (Blueprint $table) {
$table->id();
$table->foreignId('product_id')->constrained('products');
$table->date('date');
$table->float('margin')->default(0);
$table->unsignedBigInteger('nb_sale')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('stats');
}
}