This commit is contained in:
37
migrations/2025_06_05_175228_create_company_table.php
Normal file
37
migrations/2025_06_05_175228_create_company_table.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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');
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user