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

40 lines
1.1 KiB
PHP
Executable File

<?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('table_config', function (Blueprint $table) {
$table->unsignedInteger('id', true);
$table->integer('company_id')->unsigned()->default(0)->comment('公司ID');
$table->string('method', 50)->default('')->comment('场景');
$table->string('size', 50)->default('')->comment('表格大小');
// 配置项
$table->json('config')->comment('配置项');
MigrateService::migrateCreateInfo($table);
$table->comment('表格配置');
$table->index(['company_id', 'deleted_at'], 'company_id_deleted_at_index');
$table->index(['method', 'creator_id'], 'method_creator_id_index');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('table_config');
}
};