38 lines
986 B
PHP
38 lines
986 B
PHP
<?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');
|
||
}
|
||
};
|