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

38 lines
986 B
PHP
Raw 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('company', function (Blueprint $table) {
$table->bigIncrements('id');
$table->tinyInteger('company_type')->default(1)->comment('公司类型 1开证公司 2收货公司');
$table->string('name', 128)->default('')->comment('公司全称');
$table->tinyInteger('status')->default(1)->comment('状态: 0禁用 1正常');
$table->unique(['name', 'company_type'], 'name');
MigrateService::migrateCreateInfo($table);
$table->comment('公司表');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('company');
}
};