update platform, company, store
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
use Hyperf\Database\Schema\Schema;
|
||||
use Hyperf\Database\Schema\Blueprint;
|
||||
use Hyperf\Database\Migrations\Migration;
|
||||
use Hyperf\DbConnection\Db;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
@@ -16,9 +17,17 @@ return new class extends Migration
|
||||
$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->jsonb('ext')->nullable()->comment('额外信息');
|
||||
$table->timestampsTz();
|
||||
|
||||
// 索引
|
||||
$table->index('enabled', 'idx_companies_enabled');
|
||||
$table->index('created_at', 'idx_companies_created_at');
|
||||
$table->index('updated_at', 'idx_companies_updated_at');
|
||||
});
|
||||
|
||||
// 为 JSONB 字段创建 GIN 索引,支持高效的 JSON 查询
|
||||
Db::statement('CREATE INDEX idx_companies_ext ON companies USING GIN (ext)');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user