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