Files
wh-api/migrations/2025_06_05_160600_create_purchase_table.php
ykxiao 0b2299c427
Some checks failed
Build Docker / build (push) Has been cancelled
协程版仓库后端项目
2025-07-08 14:59:47 +08:00

56 lines
2.7 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use App\Service\MigrateService;
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('purchase', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('company_id')->unsigned()->default(0)->comment('公司ID');
$table->string('purchase_sn', 45)->default('')->comment('采购单号');
$table->json('warehouse_ids')->comment('所属的仓库ID列表');
$table->string('contract_sn', 45)->default('')->comment('采购合同号');
$table->integer('purchase_time')->default(0)->unsigned()->comment('提单日期');
$table->tinyInteger('customer_type')->default(1)->comment('代理类型1-代理 2-非代理');
$table->tinyInteger('container_type')->default(1)->comment('装卸类型1拆箱费整箱 2上下车费散货');
$table->smallInteger('container_count')->default(0)->unsigned()->comment('箱量/车次');
$table->smallInteger('original_count')->default(0)->unsigned()->comment('码单件数');
$table->decimal('original_cube', 12, 4)->default(0)->unsigned()->comment('码单方数');
$table->smallInteger('receiving_container')->default(0)->unsigned()->comment('收到的货柜数或车次');
$table->smallInteger('receiving_count')->default(0)->unsigned()->comment('收货件数');
$table->decimal('receiving_cube', 12, 4)->default(0)->unsigned()->comment('收货方数');
$table->integer('kz_company_id')->default(0)->unsigned()->comment('开证公司id');
$table->string('kz_company_name', 45)->default('')->comment('开证公司');
$table->integer('sh_company_id')->default(0)->unsigned()->comment('收货公司id');
$table->string('sh_company_name', 45)->default('')->comment('收货公司');
$table->string('remark', 255)->default('')->comment('备注');
$table->tinyInteger('is_from_erp')->default(0)->comment('是否erp提交的数据0否1是');
$table->integer('erp_return_id')->default(0)->unsigned()->comment('对应的erp退货单id,默认0不是退货单');
$table->tinyInteger('status')->default(1)->comment('状态: 0结束 1正在执行');
MigrateService::migrateCreateInfo($table);
$table->comment('采购单表');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('purchase');
}
};