ClearBowl/api/database/migrations/2019_12_04_112630_create_products_table.php

37 lines
806 B
PHP
Raw Normal View History

2019-12-04 12:49:41 +01:00
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('products', function (Blueprint $table) {
2019-12-15 15:45:22 +01:00
$table->increments('id');
2019-12-04 12:49:41 +01:00
$table->string('name')->unique();
2019-12-15 15:45:22 +01:00
$table->integer('kcal')->unsigned();
$table->float('carbohydrates');
$table->float('protein');
$table->float('fat');
2019-12-04 12:49:41 +01:00
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('products');
}
}