ufutx.dma/database/migrations/2023_06_10_150047_create_food_table.php
2026-03-04 14:42:40 +08:00

36 lines
840 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('food', function (Blueprint $table) {
$table->id();
$table->enum('type', ["FOOD", "NUTRIENT"])->comment('类型,食物和营养素');
$table->string('name')->comment('名称');
$table->string('icon')->comment("图标");
$table->string('unit')->nullable()->comment("单位");
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('food');
}
};