lcly-data-admin/database/migrations/2022_11_02_104745_create_ma...

41 lines
1.2 KiB
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('materiels', function (Blueprint $table) {
$table->id();
$table->string('name')->comment('名称');
$table->tinyInteger('type')->comment('类型: 1 饲料, 2 肥料');
$table->integer('year')->comment('年');
$table->tinyInteger('quarter')->comment('季度');
$table->unsignedBigInteger('lowest_price')->comment('最低价格');
$table->unsignedBigInteger('highest_price')->comment('最低价格');
$table->string('unit')->comment('单位');
$table->unsignedBigInteger('created_by')->comment('创建人ID');
$table->unsignedBigInteger('updated_by')->comment('修改人ID');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('materiels');
}
};