kcal/database/migrations/2020_12_21_215932_create_re...

41 lines
1.0 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRecipesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('recipes', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->longText('description')->nullable();
$table->longText('description_delta')->nullable();
$table->integer('time_prep')->nullable();
$table->integer('time_cook')->nullable();
$table->string('source')->nullable();
$table->unsignedInteger('servings');
$table->unsignedFloat('weight')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('recipes');
}
}