32 lines
864 B
PHP
32 lines
864 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
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('companies', function (Blueprint $table) {
|
||
|
|
$table->bigIncrements('id');
|
||
|
|
$table->string('name')->unique()->comment('公司名 英文');
|
||
|
|
$table->string('label')->nullable()->default('null')->comment('公司名 中文');
|
||
|
|
$table->boolean('enabled')->default('true')->comment('激活状态');
|
||
|
|
$table->text('ext')->default('null')->comment('额外信息');
|
||
|
|
$table->datetimes();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Reverse the migrations.
|
||
|
|
*/
|
||
|
|
public function down(): void
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('companies');
|
||
|
|
}
|
||
|
|
};
|