40 lines
1.1 KiB
PHP
Executable File
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');
|
|
}
|
|
};
|